@@ -68,8 +68,9 @@ nyc --extension .jsx --extension .es6 npm test
68
68
```
69
69
70
70
``` json
71
- {"nyc" : {
72
- "extensions" : [
71
+ {
72
+ "nyc" : {
73
+ "extensions" : [
73
74
" .jsx" ,
74
75
" .es6"
75
76
]
@@ -121,7 +122,7 @@ You can tell nyc to exclude specific files and directories by adding
121
122
an ` nyc.exclude ` array to your ` package.json ` . Each element of
122
123
the array is a glob pattern indicating which paths should be omitted.
123
124
124
- Globs are matched using [ micromatch] ( https://www.npmjs.com/package/micromatch )
125
+ Globs are matched using [ micromatch] ( https://www.npmjs.com/package/micromatch ) .
125
126
126
127
In addition to patterns specified in the package, nyc will always exclude
127
128
files in ` node_modules ` .
@@ -131,8 +132,9 @@ any files with the extension `.spec.js`, and anything in the `build`
131
132
directory:
132
133
133
134
``` json
134
- {"nyc" : {
135
- "exclude" : [
135
+ {
136
+ "nyc" : {
137
+ "exclude" : [
136
138
" **/*.spec.js" ,
137
139
" build"
138
140
]
@@ -176,7 +178,7 @@ You can run `nyc` with the optional `--cache` flag, to prevent it from
176
178
instrumenting the same files multiple times. This can signficantly
177
179
improve runtime performance.
178
180
179
- ## Configuring nyc
181
+ ## Configuring ` nyc `
180
182
181
183
Any configuration options that can be set via the command line
182
184
can also be specified in the ` nyc ` stanza of your package.json:
@@ -187,7 +189,7 @@ can also be specified in the `nyc` stanza of your package.json:
187
189
"lines" : 99 ,
188
190
"check-coverage" : false ,
189
191
"report-dir" : " ./alternative"
190
- },
192
+ }
191
193
}
192
194
```
193
195
@@ -210,28 +212,28 @@ integrated with coveralls and travis-ci.org:
210
212
211
213
1. add the coveralls and nyc dependencies to your module:
212
214
213
- ` ` ` shell
214
- npm install coveralls nyc --save
215
- ```
215
+ ` ` ` shell
216
+ npm install coveralls nyc --save
217
+ ```
216
218
217
219
2 . update the scripts in your package.json to include these bins:
218
220
219
- ``` bash
220
- {
221
- " script" : {
222
- " test" : " nyc tap ./test/*.js" ,
223
- " coverage" : " nyc npm test && nyc report --reporter=text-lcov | coveralls" ,
221
+ ``` json
222
+ {
223
+ "script" : {
224
+ "test" : " nyc tap ./test/*.js" ,
225
+ "coverage" : " nyc report --reporter=text-lcov | coveralls"
226
+ }
224
227
}
225
- }
226
- ```
228
+ ```
227
229
228
230
3 . For private repos, add the environment variable ` COVERALLS_REPO_TOKEN ` to travis.
229
231
230
232
4 . add the following to your ` .travis.yml ` :
231
233
232
- ``` yaml
233
- after_success : npm run coverage
234
- ` ` `
234
+ ``` yaml
235
+ after_success : npm run coverage
236
+ ` ` `
235
237
236
238
That's all there is to it!
237
239
0 commit comments