You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -181,17 +181,6 @@ You can specify custom coverage reporter(s) to use. For example to output text s
181
181
182
182
**Tip:** find list of reporters [here](https://istanbul.js.org/docs/advanced/alternative-reporters/)
183
183
184
-
## NYC
185
-
186
-
This module tries to find the `nyc` tool using [bin-up][bin-up], so it would be found in the current `node_modules/.bin` or folders up the parent chain
187
-
188
-
```text
189
-
node_modules/.bin/
190
-
../node_modules/.bin/
191
-
../../node_modules/.bin/
192
-
etc
193
-
```
194
-
195
184
## Custom NYC command
196
185
197
186
Sometimes NYC tool might be installed in a different folder not in the current or parent folder, or you might want to customize the report command. In that case, put the custom command into `package.json` in the current folder and this plugin will automatically use it.
@@ -204,42 +193,14 @@ Sometimes NYC tool might be installed in a different folder not in the current o
204
193
}
205
194
```
206
195
207
-
See examples below.
208
-
209
-
### Install NYC on the fly
210
-
211
-
The simplest solution: let `npx` install `nyc` on the fly
**Tip:** finding and running pre-installed tool is always faster than installing it again and again.
234
-
235
196
## TypeScript users
236
197
237
198
TypeScript source files are NOT included in the code coverage report by default, even if they are properly instrumented. In order to tell `nyc` to include TS files in the report, you need to:
238
199
239
200
1. Add these dev dependencies that let Istanbul work with TypeScript
240
201
241
202
```shell
242
-
npm i -D @istanbuljs/nyc-config-typescript source-map-support ts-node
203
+
npm i -D @istanbuljs/nyc-config-typescript source-map-support
243
204
```
244
205
245
206
2. In `package.json` use the following `nyc` configuration object
@@ -253,6 +214,8 @@ npm i -D @istanbuljs/nyc-config-typescript source-map-support ts-node
253
214
}
254
215
```
255
216
217
+
See [examples/ts-example](examples/ts-example)
218
+
256
219
## Exclude code
257
220
258
221
You can exclude parts of the code or entire files from the code coverage report. See [Istanbul guide](https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md). Common cases:
@@ -393,4 +356,3 @@ This project is licensed under the terms of the [MIT license](LICENSE.md).
0 commit comments