-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
💥 Regression Report
toStrictEqual does not consider arrays with objects having undefined values correctly.
Starting at 24.0.0, [{a: undefined}] is strict equal to [{}] - while {a: undefined} and {} are not strict equal.
Last working version
Worked up to version: 23.6.0
Stopped working in version: 24.0.0
To Reproduce
Steps to reproduce the behavior:
// Fails starting at 24.0.0
expect([{a: undefined}]).not.toStrictEqual([{}]);
// While the following is still true
expect({a: undefined}).not.toStrictEqual({});Expected behavior
The following assertion should not fail:
expect([{a: undefined}]).not.toStrictEqual([{}]);Indeed {a: undefined} is not {}.
Run npx envinfo --preset jest
Paste the results here:
$ npx envinfo --preset jest
npx : 1 installé(s) en 4.679s
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Binaries:
Node: 10.12.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.10.1 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.7.0 - C:\Program Files\nodejs\npm.CMD