-
-
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
Empty describe block throws error #6224
Comments
I originally filed this over at jest-community/vscode-jest#298 but it looks to be a generic jest issue |
This is basically #5558, but for |
Yep I'll give it a crack |
Awesome, looking forward to it :) |
hi, i would like to jump in into this issue |
@eddiesholl sorry i didn't notice that you have already started working on it .. its my first contribution to this project |
looks like this can be closed based on #6372 |
Right, 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. |
🐛 Bug Report
If a
describe
block is left empty, with no tests passed to it, an error is thrown because the list of tests is not defined. Whether this is valid or not, it should probably return a specific message instead of a cryptic runtime error.If I have an empty
describe
like:describe('Scenario needing some tests')
It will fail with
Cannot read property 'length' of undefined
:Personally I find the workflow of creating a
describe
block for every set of tests I know I will need up front, and then coming back and filling them in as I get time, to be really useful. Some may argue that it should be considered invalid, but in that case it should throw an error explaining as much.To Reproduce
Just create a
describe
instance with only a name param suppliedExpected behavior
Either no error at all, or a friendly error message like 'Every describe block requires some tests'
Link to repl or repo (highly encouraged)
https://repl.it/repls/UnselfishAmusedNanocad
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: