Rule tester output not applying all fixes
See original GitHub issueTell us about your environment
- ESLint Version: 5.10.x
- Node Version: 6-11
While working with rules RuleTester is not applying all fixes, but CLI does.
In RuleTester we have something like this, it means that we are accessing SourceCodeFixer dirrectly instead of having similar logic to verifyAndFix
from Linter
const fixResult = SourceCodeFixer.applyFixes(item.code, messages);
assert.strictEqual(fixResult.output, item.output, "Output is incorrect.");
Fixed output of tests is “processed” once instead of ‘less than 10 if there are still fixes to apply’
- Linter:verifyAndFix - https://github.com/eslint/eslint/blob/master/lib/linter.js#L1010
- RuleTester:testInvalidTemplate - https://github.com/eslint/eslint/blob/master/lib/testers/rule-tester.js#L567
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:22 (14 by maintainers)
Top Results From Across the Web
Fix program errors and improve code - Visual Studio (Windows)
Click on any line of code, right-click to open the context menu, and select Quick Actions and refactorings.
Read more >Functional Testing: A Complete Guide with Types and Example
An In-Depth Comprehensive Functional Testing Tutorial with Types, Techniques, and Examples: What is Functional Testing?
Read more >Shrink, obfuscate, and optimize your app - Android Developers
In fact, R8 works with all of your existing ProGuard rules files, so updating the Android Gradle plugin ... By default, this file...
Read more >Rules | Bazel
Additional attributes are implicitly added to executable and test rules ... that aspect is applied, as long as they do not define the...
Read more >What is End To End Testing? - BrowserStack
However, every application has to be tested in client or production environments. Chances are that prod environments are not always available ...
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 Free
Top 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
No. 😇 The fix of each error may be applied individually, so if it separated errors per identifier change, it may break code; an identifier was renamed but others were not renamed (it makes
ReferenceError
s).I think we can keep fixing one report by default, but we can provide an option (maybe called
applyAllFixes
) to allow plugin developer to apply all fixes, which won’t bring breaking change.