orionsoft-react-scripts
Version:
Orionsoft Configuration and scripts for Create React App.
43 lines (31 loc) • 1.06 kB
Markdown
# test-exclude
The file include/exclude logic used by [nyc](https://github.com/istanbuljs/nyc).
[](https://travis-ci.org/istanbuljs/test-exclude)
[](https://coveralls.io/github/istanbuljs/test-exclude?branch=master)
[](https://github.com/conventional-changelog/standard-version)
## Usage
```js
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_
```json
{
"name": "awesome-module",
"test": {
"include": ["**/index.js"]
}
}
```
_app.js_
```js
const exclude = require('test-exclude')
if (exclude({configKey: 'test'}).shouldInstrument('./index.js')) {
// let's instrument this file for test coverage!
}
```
## License
ISC