Compares contents of the value with contents of expected and their types.
expected
Differences from expect(value).toEqual(expected):
{ a: undefined, b: 2 }
{ b: 2 }
[, 1]
[undefined, 1]
a
b
Usage
const value = { prop: 1 };expect(value).toStrictEqual({ prop: 1 }); Copy
const value = { prop: 1 };expect(value).toStrictEqual({ prop: 1 });
Internal options that provide extra context for the matcher.
Received value.
Expected value.
Compares contents of the value with contents of
expectedand their types.Differences from expect(value).toEqual(expected):
{ a: undefined, b: 2 }does not match{ b: 2 }.[, 1]does not match[undefined, 1].aandbwill not equal a literal object with fieldsaandb.Usage