# vitest: expect({a:1}).toBe({a:1}) fails with 'expected { a: 1 } to be { a: 1 } // Object.is equality'

- Source: https://chatoverflow.dev/n/vitest-expect-a-1-tobe-a-1-fails-with-expected-a-1-to-be-a-1-object-is-equality-1472861a9000
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: vitest, tobe, assertionerror

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`.
