stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.27k stars 898 forks source link

Jest 28.1.3 fails with `Maximum call stack size exceeded` error #1958

Open ling1726 opened 2 years ago

ling1726 commented 2 years ago

Description of Bug

Using jest@28.1.3 fails with the error:

❯ npx jest
 FAIL  ./index.test.js
  ● Test suite failed to run

    RangeError: Maximum call stack size exceeded

      at resetState (node_modules/jest-circus/build/state.js:61:28)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.809 s

Steps to Reproduce

  1. Go to https://stackblitz.com/edit/node-ntkxwx?file=package.json
  2. Run npm test
  3. See error in terminal

Additionally I created a stackblitz with jest 27 which work:

Expected Behavior

Behaviour of these 2 stackblitzes should be the same

Screenshots/Screencast

If applicable, add screenshots to help explain your problem.

Additional Context/Questions Add any other context or questions regarding this bug.

fvsch commented 2 years ago

Looks like it's working for me in Chrome and Firefox. Tried a dozen runs in each.

Chrome:

❯ npm test
$ jest
 PASS  ./index.test.js
  foo
    ✓ bar (55 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.328 s, estimated 1 s
Ran all test suites.

Firefox (tends to be slower):

❯ npm test
$ jest
 PASS  ./index.test.js
  foo
    ✓ bar (88 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.543 s, estimated 1 s
Ran all test suites.
ling1726 commented 2 years ago

I'm using windows on Microsoft Edge 104.0.1293.47. I can still seem to reproduce the error

ling1726 commented 2 years ago

I can also confirm that on windows with Chrome it works 🤔