Skip to content

Instantly share code, notes, and snippets.

@guyellis
Created October 25, 2017 00:38
Show Gist options
  • Save guyellis/85248e69a0439d7c5e1d6d98579fe555 to your computer and use it in GitHub Desktop.
Save guyellis/85248e69a0439d7c5e1d6d98579fe555 to your computer and use it in GitHub Desktop.
// I was not expecting this. I changed a test using Node's assert.deepEqual() to
// Jest's toEqual().
// Node's deepEqual():
assert.deepEqual(transformed, plant);
// passed!
// Jest's toEqual():
expect(transformed).toEqual(plant);
// Fails:
- "coordinates": Array [
- 1.11,
- 2.22,
- ],
+ "coordinates": Object {
+ "0": 1.11,
+ "1": 2.22,
+ },
@guyellis
Copy link
Author

So I should have been using deepStrictEqual: nodejs/node#2657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment