Open
Description
Version
29.1.0
Steps to reproduce
Reproduction of the bug:
- Clone this repo.
git clone [email protected]:elchininet/isometric.git
- Checkout the branch bug-jest.
git checkout bug-jest
- Install dependencies:
yarn
- Run this small test:
yarn test tests/buggy-test.test.ts
- All the tests will pass without any issue (same test using
toEqual
,toStrictEqual
andtoMatchObject
) - Update jest in
package.json
from version29.0.3
to version29.1.0
- Run
yarn
again to update the package - Run again the small test:
yarn test tests/buggy-test.test.ts
- The console will hang for a while and at the end it will fail in the test
Test with toMatchObject

Expected behavior
Jest should not fail with toMatchObject
with an array of class instances, it should pass as toEqual
or toStrictEqual
pass.
Actual behavior
Jest fails to compare an array of class instances with toMatchObject
. It even fails with:
expect([rectangle]).toMatchObject([rectangle]);
Additional context
No response
Environment
System: Apple M1 Pro
Binaries:
* Node: v16.15.1
* Yarn: 1.22.19
* npm: 8.11.0
npm packages:
jest `29.0.3` => `29.1.0`