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
Jest suppresses errors in describe callback when only running specific tests #8334
Comments
Confirmed. The |
Maybe you could somehow utilise that? This is the only way I've gotten this behavior (i.e outside of explicitly returning), so maybe you could replace
Fair enough - is there anything else I should do to make this more actionable, such as opening an issue for |
The describe warning thing is a small fix, we can keep this issue open for the suppressed I guess |
#8335 for the describe warning part |
|
Can confirm not an issue using
Is there any documentation on the differences between I'm sure this'll probably be provided in a blog post when it's finally released so feel free to tell me to shush, but I figure might as well ask while I've got your eyes on this issue, in case there is a nice |
|
…ibe throws (#8335) <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. --> <!-- Please remember to update CHANGELOG.md in the root of the project if you have not done so. --> ## Summary Fixes the describe warning part of #8334 (intentionally not marking this as closing the whole issue) <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> ## Test plan Added e2e test case that fails with master build (the stdout `toBe('')` check). <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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
If you run a specific test (such as using
--testNamePattern
- there could be other ways, but this is how I found the bug), jest will eat any errors thrown outside of that test, skipping the test and sometimes complaining about a describe callback not returning a value.I did do a very minor dive into this a while ago, before I determined the cause (as when I first started jest I was getting these strange "a describe callback must not return a value", despite never returning a value) - somewhere internally something returns
null
instead ofundefined
, whichjest
doesn't know it's doing and hence complains to the developer.To Reproduce
test
/it
block, that is inside at least onedescribe
block--testNamePatten
Expected behavior
Jest tells me that the error happened, in the same manner it does when I run the
describe
block.Jest also shouldn't complain about a describe callback shouldn't have a return value (which it does even if I'm running the
describe
block - let me know if you'd like me to make a separate issue for this)Link to repl or repo (highly encouraged)
Here is an example repo.
Do
npm run showcase
to see the bug in action.Heres what it outputs on my side:
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: