-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for setupFile configuration option seems misleading #7174
Comments
We're making some changes to |
For now it probably makes sense to update the docs to say
|
I'll open a PR tonight. |
…clarity around expected setupfile behavior
…clarity around expected setupfile behavior
…y around expected setupfile behavior (#7187)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
The documentation for the
setupFile
configuration option is misleading.Here's a link to the documentation.
It states that the setupFile will be run
once per test
, however it appears that the setupFile runs once per test file.To Reproduce
Add a setupFile to your jest repository, with a console.log statement in it so you can see when it runs.
You'll notice that the console.log statement prints once per test file (test suite) in your repository, not once per test as the documentation states.
Expected behavior
Per the setupFile documentation, I would expect the setupFile to run once per test, instead of once per test file.
Link to repl or repo (highly encouraged)
Here is a link to a repo with a repro
Run
npx envinfo --preset jest
Paste the results here:
I'd be happy to make a PR to fix the docs if others agree it is unclear. Thanks for building / maintaining Jest! It is my favorite JS testing option by far, and I am slowly converting my coworkers over to it :)
The text was updated successfully, but these errors were encountered: