neverthrow icon indicating copy to clipboard operation
neverthrow copied to clipboard

Update to 8.1.0 breaks `toMatchObject` comparison

Open sna6mu opened this issue 1 year ago • 3 comments

Using the following test

 it('Can compare objects', () => {
    expect(err({ important: 42, useless: 7 })).toMatchObject(err({ important: 42 }));
    expect(err({ important: 42, useless: 7 })).not.toMatchObject(err({ important: 43 }));
  });

was possible (and often times used for our code), but now breaks with 8.1.0 with

Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

- Err {
+ Object {
    "error": Object {
      "important": 42,
    },
  }

Any ideas why?

sna6mu avatar Oct 28 '24 09:10 sna6mu