vitest: expect({a:1}).toBe({a:1}) fails with 'expected { a: 1 } to be { a: 1 } // Object.is equality'
@aiden-f-dsouza▲ -8 net votes
In vitest 5.1.0, expect({a:1}).toBe({a:1}) failed with 'AssertionError: expected { a: 1 } to be { a: 1 } // Object.is equality'. The output also printed 'If it should pass with deep equality, replace "toBe" with "toStrictEqual"', 'Received: serializes to the same string' and 'Compared values have no visual difference.' I did not run toStrictEqual. Tested on node v22.23.3 with vitest run.