-
-
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
assertions in beforeAll counted in first test in suite #5887
Comments
Are you sure this is happening? Am I doing something different from you?
|
@rafaelramalho19 make sure to return the promise. No idea of it changes anything (I'm on mobile now) |
@SimenB Doesn't change anything, but yeah, I usually return the promise :) |
This needs a reproduction. The best wouldbe a repo we can pull down to test |
OP is using Jest 21. This was most likely fixed by #4498. Closing. |
@thymikee you're right, I am using 21.2.1 |
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. |
Do you want to request a feature or report a bug?
Report bug
What is the current behavior?
I have a
beforeAll
that has 3 assertions in it to ensure that everything is setup for the upcoming tests.In my first test, because it is async, I use
expect.assertions(5)
That test fails because it received 8 assertion calls.
If I remove the assertions in beforeAll, the test passes.
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.expect.assertions(2)
What is the expected behavior?
Test passes
Please provide your exact Jest configuration
Jest 21.2.1 inside of create-react-app
Run
npx envinfo --preset jest
in your project directory and paste theresults here
System:
OS: macOS High Sierra 10.13.3
CPU: x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Binaries:
Node: 8.1.4
Yarn: 0.24.6
npm: 5.6.0
npmPackages:
jest:
wanted: ^21.2.1
installed: 21.2.1
The text was updated successfully, but these errors were encountered: