test-exclude
test for inclusion or exclusion of paths using pkg-conf and globs
Last updated 8 years ago by bcoe .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install test-exclude 
SYNC missed versions from official npm registry.

test-exclude

The file include/exclude logic used by nyc.

Build Status Coverage Status Standard Version Greenkeeper badge

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

Current Tags

  • 8.0.0                                ...           latest (9 months ago)

40 Versions

  • 8.0.0                                ...           9 months ago
  • 7.0.2                                ...           9 months ago
  • 7.0.1                                ...           2 years ago
  • 7.0.0                                ...           2 years ago
  • 6.0.0                                ...           7 years ago
  • 6.0.0-alpha.3                                ...           7 years ago
  • 6.0.0-alhpa.3                                ...           7 years ago
  • 6.0.0-alpha.2                                ...           7 years ago
  • 6.0.0-alpha.1                                ...           7 years ago
  • 6.0.0-alpha.0                                ...           7 years ago
  • 5.2.3                                ...           8 years ago
  • 5.2.2                                ...           8 years ago
  • 5.2.1                                ...           8 years ago
  • 5.2.0                                ...           8 years ago
  • 5.1.0                                ...           8 years ago
  • 5.0.1                                ...           8 years ago
  • 4.2.3                                ...           8 years ago
  • 5.0.0                                ...           8 years ago
  • 4.2.2                                ...           8 years ago
  • 4.2.1                                ...           9 years ago
  • 4.2.0                                ...           9 years ago
  • 4.1.1                                ...           10 years ago
  • 4.1.0                                ...           10 years ago
  • 4.0.3                                ...           10 years ago
  • 4.0.2                                ...           10 years ago
  • 4.0.1                                ...           10 years ago
  • 4.0.0                                ...           10 years ago
  • 3.3.0                                ...           10 years ago
  • 3.2.2                                ...           10 years ago
  • 3.2.1                                ...           10 years ago
  • 3.2.0                                ...           10 years ago
  • 3.1.0                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.1.3                                ...           10 years ago
  • 2.1.2                                ...           10 years ago
  • 2.1.1                                ...           10 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Total 193
Today 0
This Week 0
This Month 51
Last Day 0
Last Week 8
Last Month 41
Dependencies (4)
Dev Dependencies (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE