New rule: no istanbul ignore without reason
See original GitHub issueWhen using the coverageThreshold
option of jest you sometimes you have to add /* istanbul ignore next */
comments in order for your coverage to much the threshold.
Often people will add this comment with no reason of why the code is not covered (examples: covered in e2e, can’t be covered, will be covered later…).
I think the reason why it’s uncovered should be documented so other developers will know how to handle this code in the future, and that’s why this rule would be useful.
What do you think? Is it related enough to jest to be here?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Show real test coverage without 'Ignore' annotations in Istanbul
Let me explain why: The only function of these lines is to make sure the following line/statement is not included in the coverage...
Read more >Istanbul | Best of JS
Istanbul. Code coverage tool that computes statement, line, function and branch ... The exclude rules then prevent nyc instrumenting anything in a test...
Read more >Grain drain: Why Turkey can't afford to ignore Russian grain ...
The diplomatic goodwill Turkey won in its key role in the deal to unlock Ukrainian grain export is at risk as Russia may...
Read more >The Armenian Allegation of Genocide: The issue and the facts ...
The Ottoman Empire participated in no fewer than a dozen named wars, ... ignoring important events and verifiable accounts, and sometimes relying on...
Read more >babel/parser
The latest ECMAScript version enabled by default (ES2020). ... in output code, and renders annotations such as /* istanbul ignore next */ nonfunctional....
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
We should link to the recently released
eslint-plugin-istanbul
from our READMEAgreed, would be nice to get this in. Wanna provide a PR? 😀 Ideally this would be in some sort of
eslint-plugin-istanbul
, but as far as I can tell that doesn’t exist. Istanbul backs all of JS code coverage (vianyc
orc8
(as well as Jest, of course)), and such a rule seems useful for all