samedi 30 mai 2020

Setting timestamp as a number but recieving as undefined

Result of Test:

FAIL ./block.test.js Block √ has a timestamp, lastHash, hash, and data property (28 ms) genesis() √ returns a Block instance (3 ms) × returns the genesis data (21 ms)

● Block › genesis() › returns the genesis data

expect(received).toEqual(expected) // deep equality

- Expected  - 2
+ Received  + 2

- Object {
+ Block {
    "data": Array [],
    "hash": "hash-one",
    "lastHash": "-----",
-   "timesamp": 1,
+   "timestamp": undefined,
  }

  26 |
  27 |         it('returns the genesis data', () => {
> 28 |             expect(genesisBlock).toEqual(GENESIS_DATA);
     |                                  ^
  29 |         });
  30 |     });
  31 | });

  at Object.<anonymous> (block.test.js:28:34)

console.log genesisBlock Block { timestamp: undefined, lastHash: '-----', hash: 'hash-one', data: [] }

  at Suite.<anonymous> (block.test.js:21:17)

Aucun commentaire:

Enregistrer un commentaire