XuelesszzZ 94af2b8e7b 6-30-5 | 1 tahun lalu | |
---|---|---|
.. | ||
CHANGELOG.md | 1 tahun lalu | |
LICENSE.txt | 1 tahun lalu | |
README.md | 1 tahun lalu | |
index.js | 1 tahun lalu | |
package.json | 1 tahun lalu |
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!
}
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/**']
});
ISC