Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # test-exclude
  2. The file include/exclude logic used by [nyc] and [babel-plugin-istanbul].
  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 TestExclude = require('test-exclude');
  10. const exclude = new TestExclude();
  11. if (exclude().shouldInstrument('./foo.js')) {
  12. // let's instrument this file for test coverage!
  13. }
  14. ```
  15. ### TestExclude(options)
  16. The test-exclude constructor accepts an options object. The defaults are taken from
  17. [@istanbuljs/schema].
  18. #### options.cwd
  19. This is the base directory by which all comparisons are performed. Files outside `cwd`
  20. are not included.
  21. Default: `process.cwd()`
  22. #### options.exclude
  23. Array of path globs to be ignored. Note this list does not include `node_modules` which
  24. is added separately. See [@istanbuljs/schema/default-excludes.js] for default list.
  25. #### options.excludeNodeModules
  26. By default `node_modules` is excluded. Setting this option `true` allows `node_modules`
  27. to be included.
  28. #### options.include
  29. Array of path globs that can be included. By default this is unrestricted giving a result
  30. similar to `['**']` but more optimized.
  31. #### options.extension
  32. Array of extensions that can be included. This ensures that nyc only attempts to process
  33. files which it might understand. Note use of some formats may require adding parser
  34. plugins to your nyc or babel configuration.
  35. Default: `['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx']`
  36. ### TestExclude#shouldInstrument(filename): boolean
  37. Test if `filename` matches the rules of this test-exclude instance.
  38. ```js
  39. const exclude = new TestExclude();
  40. exclude.shouldInstrument('index.js'); // true
  41. exclude.shouldInstrument('test.js'); // false
  42. exclude.shouldInstrument('README.md'); // false
  43. exclude.shouldInstrument('node_modules/test-exclude/index.js'); // false
  44. ```
  45. In this example code:
  46. * `index.js` is true because it matches the default `options.extension` list
  47. and is not part of the default `options.exclude` list.
  48. * `test.js` is excluded because it matches the default `options.exclude` list.
  49. * `README.md` is not matched by the default `options.extension`
  50. * `node_modules/test-exclude/index.js` is excluded because `options.excludeNodeModules`
  51. is true by default.
  52. ### TestExculde#globSync(cwd = options.cwd): Array[string]
  53. This synchronously retrieves a list of files within `cwd` which should be instrumented.
  54. Note that setting `cwd` to a parent of `options.cwd` is ineffective, this argument can
  55. only be used to further restrict the result.
  56. ### TestExclude#glob(cwd = options.cwd): Promise<Array[string]>
  57. This function does the same as `TestExclude#globSync` but does so asynchronously. The
  58. Promise resolves to an Array of strings.
  59. ## `test-exclude` for enterprise
  60. Available as part of the Tidelift Subscription.
  61. The maintainers of `test-exclude` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-test-exclude?utm_source=npm-test-exclude&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
  62. [nyc]: https://github.com/istanbuljs/nyc
  63. [babel-plugin-istanbul]: https://github.com/istanbuljs/babel-plugin-istanbul
  64. [@istanbuljs/schema]: https://github.com/istanbuljs/schema
  65. [@istanbuljs/schema/default-excludes.js]: https://github.com/istanbuljs/schema/blob/master/default-exclude.js