RuleTester should throw if test has output but rule is new-style and lacks meta.fixable property
See original GitHub issueAs discussed in the chat, it’s pretty easy to forget to add meta.fixable
to a new-style rule and then the unit tests simply won’t run auto-fix.
It might be worthwhile to add an assertion to RuleTester. If the test has output
property and the rule has meta
but does not have meta.fixable
set to code or whitespace, an assertion failure should be thrown here so that the developer knows that meta.fixable
needs to be set on the rule.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Writing custom TypeScript Eslint rules with unit tests for ...
After reading this article you will know how to create a custom Eslint rule in Typescript for Angular project and how to test...
Read more >Multiple assertions per test may actually be OK - Corey Cleary
But testing each property one by one may be valid if you have a function that returns an object where you don't care...
Read more >Changelog — StackStorm 3.8.0 documentation
This command will first try to find a matching alias (same as st2 action-alias match command) and if a match is found, trigger...
Read more >AssertionError on RuleTester for ESlint rule - Stack Overflow
I have written a custom ESLint rule for a NodeJS application. The rule works as expected. However, I am facing issue running Unit...
Read more >Advanced googletest Topics
GoogleTest - Google Testing and Mocking Framework. ... Therefore, sometimes a user has to use EXPECT_TRUE() to check a complex expression, for lack...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d like to work on this one if it gets accepted 😃
@nzakas @ilyavolodin please let me know if this is what you had in mind: #6043