Compares value with expected by calling Object.is. This method compares objects by reference instead of their contents, similarly to the strict equality operator ===.
expected
Object.is
===
Usage
const value = { prop: 1 };expect(value).toBe(value);expect(value).not.toBe({});expect(value.prop).toBe(1); Copy
const value = { prop: 1 };expect(value).toBe(value);expect(value).not.toBe({});expect(value.prop).toBe(1);
Internal options that provide extra context for the matcher.
Received value.
Expected value.
Compares value with
expectedby callingObject.is. This method compares objects by reference instead of their contents, similarly to the strict equality operator===.Usage