-
-
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
"done" should fail when called multiple times #7052
Comments
done
should fail when called multiple times
I agree this should fail. Wanna send a PR for it? 😀 |
Hey, I'd like to take this up. Don't have enough context as it is though. From what I understand, this will have to be updated in both circus and jasmine(Env.js?). Could you give me a place to start? |
Circus: https://github.com/facebook/jest/blob/e2dac2ba04bd0655d7f81a02907375429746c05a/packages/jest-circus/src/utils.js#L180-L196 I'm personally fine fixing this just in Circus, but if both are easy, go for it 🙂 |
The code for circus looks like something I can work with. The one for jasmine I don't quite grok. I don't see where the callback is provided. Basically what I plan on doing is to wrap done in a higher order function which increments a variable for |
Hello, me and another student are trying to fix this issue for a course in college. However, it's our first time working with jest so we are not so sure which files to run to reproduce this issue... Can you please replicate it in repl.it? |
Hey @jmcsilva98, really happy to hear that! Here's a repl.it, if you run this then the test passes but the OP requests that we fail it. The message could be something like "Expected done to be called once but it was called multiple times" Here is a good place to start looking to add the feature. Note that this is the jest-circus runner so you should follow these instructions to run Finally, here are some instructions on how to setup jest locally as well. These docs aren't our best, so if you have any questions, feel free to reach out to me on twitter or the reactiflux discord and I'd be happy to help! |
May I give this a shot? |
That would be great, thanks! |
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. |
I did some online searching and didn't find any discussion, so let me know if this is as expected. Happy to do a PR if this should be correct behavior
🐛 Bug Report
Calling
done()
multiple times in one test should be a failure, but it succeedsTo Reproduce
Expected behavior
Test fails with
"done" called multiple times
or some such messageLink to repl or repo (highly encouraged)
Above code snippet showcases issue. Looks like following test could be added to e2e failures:
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: