-
-
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
Re-allowed single string arguments for pending tests #6602
Conversation
1459c8c
to
e979bbe
Compare
- Continues to validate arguments to avoid accidental skips from jestjs#5558
e979bbe
to
0d0aad3
Compare
+1 for this. Is there anything I can do to help? |
@gavboulton if you'd like to diagnose why the circus suite is failing and rebase, that would be a big help in getting this mergeable! |
With |
What about copying Ava, which uses a modifier ( @thymikee @rickhanlonii thoughts on that? |
@SimenB I think |
I don't think it's worth re-litigating the need for this. That was already done in #6430 and #6256 and there's clearly a desire/need for this behaviour. We should focus instead on making this work and try to support @gavboulton |
The whole point of removing the functionality in the first place was to remove a footgun. Reintroducing it behind explicit function calls seems like a good middleground to me. We can also update the error message on just a string to include something like "if you meant to create a placeholder test, please use |
Thanks for the input guys. My preference would still be
|
Seems I may have jumped the gun. I took the existence of this pull request along with the comment by @rickhanlonii as evidence that this was a done deal. FWIW I agree that |
@gavboulton @arcdev1 I've just opened #6996 to add |
@mattphillips #6996 looks pretty slick. Good job! |
Looks great! Thanks everyone for coming up with a nice solution |
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
This PR updates the logic in the jasmine and circus reporters to allow valid single string arguments. It still keeps the nice feature work from #5558 that noisily fails on accidental pending tests or other incorrect arguments.
This solves #6430 and #6256, allowing teams (mine included) and individuals that are used to starting off with writing pending tests to continue to use this workflow. I appreciate the flexibility from the contributors on this and think moving to a linter rule would be great for those who want to avoid committing or merging pending tests.
EDIT: It looks like there is already a linter rule for avoiding single-argument (pending) tests here https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-disabled-tests.md so I think we should have everything to merge this.
Let me know if I can address any concerns! Thanks.
Test plan
Snapshots were updates with the pending style again. For the package tests, I opted to leave the tests in as a
not.toThrowError
to ensure this doesn't regress unintentionally. I used the regex form for thejasmine
tests as they throw a different error with nestingit
blocks.I'm not sure why the circus suite is not running on Circle as it was working locally with
JEST_CIRCUS=1
. Any assistance would be helpful!