From f89036033055f939082041a098e5efc9f1f83a40 Mon Sep 17 00:00:00 2001 From: Sintendo Date: Sun, 27 Oct 2019 16:50:56 +0000 Subject: [PATCH] docs: Fix URL to default excludes in README.md (#1214) Also remove some trailing white-space and correct a spelling mistake. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 889c1e68d..f20787b88 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ You can then add the specific configuration options you want that aren't in that ### Configuration files -Any configuration options that can be set via the command line can also be specified in the `nyc` stanza of your package.json, or within a seperate configuration file - a variety of flavors are available: +Any configuration options that can be set via the command line can also be specified in the `nyc` stanza of your package.json, or within a separate configuration file - a variety of flavors are available: | File name | File Association | |-----------------|------------------| @@ -108,7 +108,7 @@ This table is a quick TLDR for the rest of this readme and there are more advanc Configuration can also be provided by `nyc.config.js` if programmed logic is required: ```js -'use strict'; +'use strict'; const {defaultExclude} = require('test-exclude'); const isWindows = require('is-windows'); @@ -142,7 +142,7 @@ module.exports = { By default, nyc only collects coverage for source files that are visited during a test. It does this by watching for files that are `require()`'d during the test. -When a file is `require()`'d, nyc creates and returns an instrumented version of the source, rather than the original. +When a file is `require()`'d, nyc creates and returns an instrumented version of the source, rather than the original. Only source files that are visited during a test will appear in the coverage report and contribute to coverage statistics. nyc will instrument all files if the `--all` flag is set or if running `nyc instrument`. @@ -172,7 +172,7 @@ You can also specify negated paths in the `exclude` array, by prefixing them wit Negated paths can restore paths that have been already been excluded in the `exclude` array. Multiple `exclude` globs can be specified on the command line, each must follow a `--exclude`, `-x` switch. -The default `exclude` list is defined in the [test-exclude module](https://github.com/istanbuljs/istanbuljs/blob/master/packages/test-exclude/default-exclude.js). +The default `exclude` list is defined in the [@istanbuljs/schema module](https://github.com/istanbuljs/schema/blob/master/default-exclude.js). Specifying your own exclude property completely replaces these defaults. For example, the following config will collect coverage for every file in the `src` directory regardless of whether it is `require()`'d in a test. @@ -200,7 +200,7 @@ To prevent this, wrap each glob in single quotes. We always add `**/node_modules/**` to the exclude list, even if not specified in the config. You can override this by setting `--exclude-node-modules=false`. -For example, in the following config, `"excludeNodeModules: false"` will prevent `node_modules` from being added to the exclude rules. +For example, in the following config, `"excludeNodeModules: false"` will prevent `node_modules` from being added to the exclude rules. The set of include rules then restrict nyc to only consider instrumenting files found under the `lib/` and `node_modules/@my-org/` directories. The exclude rules then prevent nyc instrumenting anything in a `test` folder and the file `node_modules/@my-org/something/unwanted.js`.