Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

README.md 1.5 KiB

3 anos atrás
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # test-exclude
  2. The file include/exclude logic used by [nyc](https://github.com/istanbuljs/nyc).
  3. [![Build Status](https://travis-ci.org/istanbuljs/test-exclude.svg)](https://travis-ci.org/istanbuljs/test-exclude)
  4. [![Coverage Status](https://coveralls.io/repos/github/istanbuljs/test-exclude/badge.svg?branch=master)](https://coveralls.io/github/istanbuljs/test-exclude?branch=master)
  5. [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
  6. [![Greenkeeper badge](https://badges.greenkeeper.io/istanbuljs/test-exclude.svg)](https://greenkeeper.io/)
  7. ## Usage
  8. ```js
  9. const exclude = require('test-exclude')
  10. if (exclude().shouldInstrument('./foo.js')) {
  11. // let's instrument this file for test coverage!
  12. }
  13. ```
  14. _you can load configuration from a key in package.json:_
  15. _package.json_
  16. ```json
  17. {
  18. "name": "awesome-module",
  19. "test": {
  20. "include": ["**/index.js"]
  21. }
  22. }
  23. ```
  24. _app.js_
  25. ```js
  26. const exclude = require('test-exclude')
  27. if (exclude({configKey: 'test'}).shouldInstrument('./index.js')) {
  28. // let's instrument this file for test coverage!
  29. }
  30. ```
  31. ## Including node_modules folder
  32. by default the `node_modules` folder is added to all groups of
  33. exclude rules. In the rare case that you wish to instrument files
  34. stored in `node_modules`, a negative glob can be used:
  35. ```js
  36. const exclude = require('test-exclude')
  37. const e = exclude({
  38. exclude: ['!**/node_modules/**']
  39. })
  40. ```
  41. ## License
  42. ISC