Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

test-exclude

Package Overview
Dependencies
47
Maintainers
3
Versions
36
Issues
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

test-exclude

test for inclusion or exclusion of paths using pkg-conf and globs

    5.2.2
    GitHub
    npm

Version published
Maintainers
3
Weekly downloads
22,492,338
decreased by-7.78%

Weekly downloads

Changelog

Source

5.2.2 (2019-04-09)

Note: Version bump only for package test-exclude

Readme

Source

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

Keywords

FAQs

Last updated on 09 Apr 2019

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc