How to use test-exclude - 5 common examples

To help you get started, we’ve selected a few test-exclude examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Eywek / v8-coverage / bin / cov8.js View on Github external
'use strict'

const yargs = require('yargs')
const exclude = require('test-exclude')
const sw = require('spawn-wrap')
const foreground = require('foreground-child')
const mkdirp = require('mkdirp')
const rimraf = require('rimraf')
const path = require('path')

yargs // eslint-disable-line
  .usage('$0 [opts] 
github shinnn / coverage / index.js View on Github external
1,
				nodePath,
				...ext === 'mjs' ? [
					'--experimental-modules',
					'--es-module-specifier-resolution=node',
					'--no-warnings'
				] : [],
				entryPath
			);
		}

		return [
			nodePath,
			[
				c8BinPath,
				...require('test-exclude').defaultExclude.map(pattern => `--exclude="${
					pattern
					// Remove this when https://github.com/istanbuljs/istanbuljs/pull/381 is merged
					.replace(/(?<=\.)(?=js$)/ui, '{,c,m}')
					// Remove this when https://github.com/istanbuljs/istanbuljs/pull/419 is merged
					.replace(/(?<=test)(?=\/)/ui, '{,s}')
				}"`),
				'--exclude="**/*.json"',
				...reporter === undefined ? [
					'--reporter=text',
					`--reporter=${willUploadLcov ? 'lcovonly' : 'html'}`
				] : [],
				...optionArgs
			]
		];
	})();
github eggjs / egg-bin / lib / cmd / cov.js View on Github external
type: 'boolean',
      },
      nyc: {
        description: 'nyc instruments passthrough',
        type: 'string',
        default: '--temp-directory ./node_modules/.nyc_output -r text-summary -r json-summary -r json -r lcov',
      },
    };

    // you can add ignore dirs here
    this[EXCLUDES] = new Set([
      'example/',
      'examples/',
      'mocks**/',
      'docs/',
    ].concat(testExclude.defaultExclude));
  }
github istanbuljs / babel-plugin-istanbul / src / index.js View on Github external
return function shouldSkip (file, nycConfig) {
    if (!exclude || (exclude.cwd !== nycConfig.cwd)) {
      exclude = new TestExclude({
        cwd: nycConfig.cwd,
        include: nycConfig.include,
        exclude: nycConfig.exclude,
        extension: nycConfig.extension,
        // Make sure this is true unless explicitly set to `false`. `undefined` is still `true`.
        excludeNodeModules: nycConfig.excludeNodeModules !== false
      })
    }

    return !exclude.shouldInstrument(file)
  }
}
github splunk / splunk-sdk-javascript / node_modules / nyc / lib / commands / report.js View on Github external
})
    .option('report-dir', {
      describe: 'directory to output coverage reports in',
      default: 'coverage'
    })
    .option('temp-dir', {
      alias: 't',
      describe: 'directory to read raw coverage information from',
      default: './.nyc_output'
    })
    .option('temp-directory', {
      hidden: true
    })
    .option('exclude', {
      alias: 'x',
      default: testExclude.defaultExclude,
      describe: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported, node_modules is always excluded',
      global: false
    })
    .option('exclude-node-modules', {
      default: true,
      type: 'boolean',
      describe: 'whether or not to exclude all node_module folders (i.e. **/node_modules/**) by default',
      global: false
    })
    .option('exclude-after-remap', {
      default: true,
      type: 'boolean',
      description: 'should exclude logic be performed after the source-map remaps filenames?',
      global: false
    })
    .option('include', {

test-exclude

test for inclusion or exclusion of paths using globs

ISC
Latest version published 6 months ago

Package Health Score

76 / 100
Full package analysis

Popular test-exclude functions