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
Change Request: Stricter rule test validation #15104
Comments
This seems reasonable to me, however, it is a breaking change and would need to wait until ESLint v9.0.0, which won’t be until next year. That’s a really long time to wait, so not sure the best path forward here. |
Would this require an RFC? If so, I can put that together so that it can be lined up for v9. Also, have we begun tracking breaking changes for v9 yet? Even though it's a year away, I'd like to make sure this gets on the list (assuming it gets accepted). |
Yes, we would need an RFC. and yes, we are tracking features for v9 on the v9 project. |
Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update. |
Still planning to do this, assigned myself. |
I have opened an RFC for this issue, along with some related rule test validation improvements: eslint/rfcs#84 |
👎 for this. In some rule, I only add one test for the The tester should not force anything, test one thing in one case is good practice! |
Please review the RFC and leave your comments there. |
Reopening since the RFC hasn't been implemented yet. |
suggestions
assertion
Since the related eslint/rfcs#84 includes more changes than just requiring suggestion assertions, I changed the title of this issue so that it tracks all the changes, i.e. the full implementation of eslint/rfcs#84:
|
ESLint version
8.0.0-rc.0
What problem do you want to solve?
suggestions: []
to every single invalid test case for a rule or tests that do not produce suggestions, in order to achieve the desired test coverage.What do you think is the correct solution?
Invalid test cases that yield suggestions should require a
suggestions
assertion.This would be the same as how invalid test cases that produce an autofix require an
output
assertion, and fail with this error:This behavior was added as a breaking change in ESLint v7.
We should add a similar assertion for suggestions.
Example of invalid test case with suggestions assertion:
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: