gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

[Feature Request] Ignoring parts of file like functions currently not possible #775

Open sagiavinash opened 7 years ago

sagiavinash commented 7 years ago

I have gone through this doc for coverage ignore comments https://github.com/gotwarlost/istanbul#ignoring-code-for-coverage

but i am not able to ignore a function all together in a file

// module.js
function testedFn() {
  // do something
}

/* istanbul ignore next */
function untestedFn() {
  // do something
}

This is important for transisition phase of codebase from being completely untested to completely tested. Within a module the priority to test a particular function is not the same. So please allow removing certain parts of a file to be ignored.

ESLint has really good ignore comment utilities like /* eslint-disable */ and /* eslint-enable */ that allow progressively making the codebase compliant