budibase/packages/common/node_modules/test-exclude
Martin McKeaveney 228999aba5 backend allowing creation of models, records and databases 2020-04-20 16:17:18 +01:00
..
CHANGELOG.md backend allowing creation of models, records and databases 2020-04-20 16:17:18 +01:00
LICENSE.txt building out new budibase API 2020-04-15 15:23:29 +01:00
README.md backend allowing creation of models, records and databases 2020-04-20 16:17:18 +01:00
index.js backend allowing creation of models, records and databases 2020-04-20 16:17:18 +01:00
package.json backend allowing creation of models, records and databases 2020-04-20 16:17:18 +01:00

README.md

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