-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
💥 Regression Report
I'm not sure it's a regression and I guess using Jest well, but it seems the setupFiles and setupFilesAfterEnv modules are no longer blocking in the Jest execution sequence flow.
I mean, if there is an async function in one of the setupFiles or setupFilesAfterEnv Jest doesn't wait the end of the promise.
Last working version
Worked up to version: ?
Stopped working in version: 24.9.0
To Reproduce
Create a simple project like this :
https://repl.it/join/tlxcxyac-mathieubreton
By running a yarn test you should see that:
yarn test
yarn run v1.22.5
$ jest
console.log
============== Setup file ==============
at setup.js:2:11
console.log
---------- Sum test ----------
at Object.<anonymous> (sum.test.js:5:13)
PASS ./sum.test.js
sum
✓ adds 1 + 2 to equal 3 (3 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.808 s, estimated 2 s
Ran all test suites.
console.log
END ------ Sum test ------ END
at sum.test.js:8:17
console.log
test
at Object.<anonymous> (sum.test.js:14:13)
✨ Done in 2.56s.
Expected behavior
Jest should wait the end of the promise resolution in the setupFiles or setupFilesAfterEnv before continue and wait to execute test suites.
Link to repl or repo (highly encouraged)
https://repl.it/join/tlxcxyac-mathieubreton
Run npx envinfo --preset jest
npx envinfo --preset jest
npx: installed 1 in 2.177s
System:
OS: macOS 11.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 14.9.0 - ~/.nvm/versions/node/v14.9.0/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 6.14.9 - ~/.nvm/versions/node/v14.9.0/bin/npm
npmPackages:
jest: ^26.6.3 => 26.6.3