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
feat: refactored config to fix precedence of config vs. args (#388)
* feat: refactored config to fix precedence of config vs. args see #379
* fix: address standard nits
* fix: remove cruft from package.json
* fix: address @mourner's code review
@@ -123,158 +94,3 @@ function checkCoverage (argv, cb) {
123
94
statements: argv.statements
124
95
})
125
96
}
126
-
127
-
functionbuildYargs(){
128
-
returnYargs([])
129
-
.usage('$0 [command] [options]\n\nrun your tests with the nyc bin to instrument them with coverage')
130
-
.command('report','run coverage report for .nyc_output',function(yargs){
131
-
returnyargs
132
-
.usage('$0 report [options]')
133
-
.option('reporter',{
134
-
alias: 'r',
135
-
describe: 'coverage reporter(s) to use',
136
-
default: 'text'
137
-
})
138
-
.option('report-dir',{
139
-
describe: 'directory to output coverage reports in',
140
-
default: 'coverage'
141
-
})
142
-
.option('temp-directory',{
143
-
describe: 'directory from which coverage JSON files are read',
144
-
default: './.nyc_output'
145
-
})
146
-
.option('show-process-tree',{
147
-
describe: 'display the tree of spawned processes',
148
-
default: false,
149
-
type: 'boolean'
150
-
})
151
-
.example('$0 report --reporter=lcov','output an HTML lcov report to ./coverage')
152
-
})
153
-
.command('check-coverage','check whether coverage is within thresholds provided',function(yargs){
154
-
returnyargs
155
-
.usage('$0 check-coverage [options]')
156
-
.option('branches',{
157
-
default: 0,
158
-
description: 'what % of branches must be covered?'
159
-
})
160
-
.option('functions',{
161
-
default: 0,
162
-
description: 'what % of functions must be covered?'
163
-
})
164
-
.option('lines',{
165
-
default: 90,
166
-
description: 'what % of lines must be covered?'
167
-
})
168
-
.option('statements',{
169
-
default: 0,
170
-
description: 'what % of statements must be covered?'
171
-
})
172
-
.example('$0 check-coverage --lines 95',"check whether the JSON in nyc's output folder meets the thresholds provided")
173
-
})
174
-
.option('reporter',{
175
-
alias: 'r',
176
-
describe: 'coverage reporter(s) to use',
177
-
default: 'text'
178
-
})
179
-
.option('report-dir',{
180
-
describe: 'directory to output coverage reports in',
181
-
default: 'coverage'
182
-
})
183
-
.option('silent',{
184
-
alias: 's',
185
-
default: false,
186
-
type: 'boolean',
187
-
describe: "don't output a report after tests finish running"
188
-
})
189
-
.option('all',{
190
-
alias: 'a',
191
-
default: false,
192
-
type: 'boolean',
193
-
describe: 'whether or not to instrument all files of the project (not just the ones touched by your test suite)'
194
-
})
195
-
.option('exclude',{
196
-
alias: 'x',
197
-
default: testExclude.defaultExclude,
198
-
describe: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported, node_modules is always excluded'
199
-
})
200
-
.option('include',{
201
-
alias: 'n',
202
-
default: [],
203
-
describe: 'a list of specific files that should be covered, glob patterns are supported'
204
-
})
205
-
.option('require',{
206
-
alias: 'i',
207
-
default: [],
208
-
describe: 'a list of additional modules that nyc should attempt to require in its subprocess, e.g., babel-register, babel-polyfill.'
209
-
})
210
-
.option('cache',{
211
-
alias: 'c',
212
-
default: false,
213
-
type: 'boolean',
214
-
describe: 'cache instrumentation results for improved performance'
215
-
})
216
-
.option('extension',{
217
-
alias: 'e',
218
-
default: [],
219
-
describe: 'a list of extensions that nyc should handle in addition to .js'
220
-
})
221
-
.option('check-coverage',{
222
-
type: 'boolean',
223
-
default: false,
224
-
describe: 'check whether coverage is within thresholds provided'
225
-
})
226
-
.option('branches',{
227
-
default: 0,
228
-
description: 'what % of branches must be covered?'
229
-
})
230
-
.option('functions',{
231
-
default: 0,
232
-
description: 'what % of functions must be covered?'
233
-
})
234
-
.option('lines',{
235
-
default: 90,
236
-
description: 'what % of lines must be covered?'
237
-
})
238
-
.option('statements',{
239
-
default: 0,
240
-
description: 'what % of statements must be covered?'
241
-
})
242
-
.option('source-map',{
243
-
default: true,
244
-
type: 'boolean',
245
-
description: 'should nyc detect and handle source maps?'
0 commit comments