question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New rule: no istanbul ignore without reason

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
SimenBcommented, May 10, 2020

We should link to the recently released eslint-plugin-istanbul from our README

1reaction
SimenBcommented, Apr 27, 2020

Agreed, 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 (via nyc or c8 (as well as Jest, of course)), and such a rule seems useful for all

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found