-
-
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
Better error message when a describe block is empty #6372
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
dea6999
to
fe0577e
Compare
Mind fixing CI? 🙂 |
Yep sorry, hopefully over the weekend 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I fixed the tests and merged in master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing changelog entry
@SimenB added 🙈 |
Ah, yes, we'll need to make the same updates to circus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update for jest-circus
as well. To se failure locally, run JEST_CIRCUS=1 ./jest globals
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@eddiesholl here's relevant circus code: https://github.com/facebook/jest/blob/0591f22f2347cfdf0f427e67fbfa9d203a2e3a87/packages/jest-circus/src/index.js#L31-L40 Can you update it as well? |
Codecov Report
@@ Coverage Diff @@
## master #6372 +/- ##
==========================================
- Coverage 66.67% 66.65% -0.03%
==========================================
Files 253 253
Lines 10607 10621 +14
Branches 3 4 +1
==========================================
+ Hits 7072 7079 +7
- Misses 3534 3541 +7
Partials 1 1
Continue to review full report at Codecov.
|
@eddiesholl ping, mind taking a look at fixing circus as well? 🙂 Link to relevant code in the post above mine. This also needs a rebase |
I merged in master and fixed circus. However, I broke jasmine while doing so (since I cleaned up the stack). I have to go now, so I pushed regardless, but should be pretty straight forward for somebody to make the last tweak needed for Jasmine 🙂 |
a9700b7
to
8ab258f
Compare
ebc0d65
to
d9d80e1
Compare
@@ -20,7 +20,7 @@ const TEST_DIR = path.resolve(DIR, '__tests__'); | |||
|
|||
function cleanStderr(stderr) { | |||
const {rest} = extractSummary(stderr); | |||
return rest.replace(/.*(jest-jasmine2|jest-circus).*\n/g, ''); | |||
return rest.replace(/.*(jest-jasmine2).*\n/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to strip out circus stuff as we always create an error without any circus traces in it. Can't be bothered doing the same fix for jasmine, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed the linting error locally. will push and merge if/when green
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
When you create an empty
describe
block with no body, the error message returned is obscure. If you have done it by accident, it doesn't give you any help trying to correct the problem.The same type of helpful error is already returned for empty
it
blocks, this is just taking the same approach to checking the params supplied.This was raised originally in #6224
Test plan
Before
After