zordius / gulp-jsx-coverage

deprecated
https://www.npmjs.com/package/gulp-jsx-coverage
Other
34 stars 10 forks source link

How to ignore coverage with istanbul ignore hints #28

Closed cliren closed 8 years ago

cliren commented 8 years ago

/* istanbul ignore next: untestable */

Adding the above ignore hint at the begging of a file doesn't seem to ignore coverage for a specific file (https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md). The only thing that seems to work using this gulp-jsx-coverage is the exclude option of istanbul as shown below. Has anyone seen this behavior ?

istanbul: {
      coverageVariable: "__MY_TEST_COVERAGE__",
      exclude: /node_modules|spec|yourfile|yourdirectory/
    }
zordius commented 8 years ago

/* istanbul ignore next */ work on a anything and it only works for a file when the file only contains a function.


/* istanbul ignore next */
function a () {
   .....
}

// This still be covered....
function b () {
    ....
}

If you like to have file level ignore, use options.istanbul.exclude is a good idea.