The file include/exclude logic used by nyc.
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!
}
ISC