package
NYC configurations
npm install @cfware/nycGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
31.2 kB
Includes dependencies.
NYC configurations used by my projects.
Create nyc.config.cjs in your project:
'use strict';
module.exports = require('@cfware/nyc')
.all()
.checkCoverage()
.exclude('build/**');All instance methods are also exposed static methods which construct a new object and run the method. For example:
const assert = require('assert');
const NYCConfig = require('@cfware/nyc');
const config1 = NYCConfig.all();
const config2 = new NYCConfig().all();
(async () {
// This will pass
assert.deepStrictEqual(await config1, await config2);
})();All methods return this to allow chaining.
Construct a new instance overwriting some nyc configuration options. No validation is performed. It is not needed to explicitly call the constructor unless:
exclude globs.This property is static only, returns a copy of the default exclude list.
This is the nyc default excludes with some additional paths:
fixtures/**helpers/**tap-snapshots/**Enable or disable all. Enabling can cause difficulties in current versions of node.js
when the repository contains ES modules which are not ignored.
Enable or disable checkCoverage.
Enable or disable perFile (only effective if checkCoverage is enabled)
Append the require configuration array.
Append the include configuration array.
Append the exclude configuration array.
Enable or disable excludeNodeModules.
Add one or more coverage reporters to run. Note the first call to this function will replace the nyc default.
The defaults provided by this module are:
{
tempDir: 'coverage/.nyc_output',
require: [],
include: [],
exclude: NYCConfig.defaultExclude,
lines: 100,
statements: 100,
functions: 100,
branches: 100
}nyc will apply additional defaults for keys not listed here.