huanggang 03a863fb53 add node_modules 7 年之前
..
test 03a863fb53 add node_modules 7 年之前
.editorconfig 03a863fb53 add node_modules 7 年之前
.npmignore 03a863fb53 add node_modules 7 年之前
.travis.yml 03a863fb53 add node_modules 7 年之前
CHANGELOG.md 03a863fb53 add node_modules 7 年之前
LICENSE.txt 03a863fb53 add node_modules 7 年之前
README.md 03a863fb53 add node_modules 7 年之前
index.js 03a863fb53 add node_modules 7 年之前
package.json 03a863fb53 add node_modules 7 年之前

README.md

test-exclude

The file include/exclude logic used by nyc.

Build Status Coverage Status Standard Version

Usage

const exclude = require('test-exclude')
if (exclude().shouldInstrument('./foo.js')) {
  // let's instrument this file for test coverage!
}

you can load configuration from a key in package.json:

package.json

{
  "name": "awesome-module",
  "test": {
    "include": ["**/index.js"]
  }
}

app.js

const exclude = require('test-exclude')
if (exclude({configKey: 'test'}).shouldInstrument('./index.js')) {
  // let's instrument this file for test coverage!
}

Including node_modules folder

by default the node_modules folder is added to all groups of exclude rules. In the rare case that you wish to instrument files stored in node_modules, a negative glob can be used:

const exclude = require('test-exclude')
const e = exclude({
  exclude: ['!**/node_modules/**']
})

License

ISC