@@ -140,6 +140,29 @@ All files | 0 | 0 | 0 | 0 |
140
140
"
141
141
` ;
142
142
143
+ exports [` c8 check-coverage --100 1` ] = `
144
+ ",hey
145
+ i am a line of code
146
+ what
147
+ hey
148
+ what
149
+ hey
150
+ what
151
+ hey
152
+ -----------|---------|----------|---------|---------|-------------------
153
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
154
+ -----------|---------|----------|---------|---------|-------------------
155
+ All files | 83.33 | 85.71 | 66.66 | 83.33 |
156
+ async.js | 100 | 100 | 100 | 100 |
157
+ normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20
158
+ -----------|---------|----------|---------|---------|-------------------
159
+ ,ERROR: Coverage for lines (83.33%) does not meet global threshold (100%)
160
+ ERROR: Coverage for functions (66.66%) does not meet global threshold (100%)
161
+ ERROR: Coverage for branches (85.71%) does not meet global threshold (100%)
162
+ ERROR: Coverage for statements (83.33%) does not meet global threshold (100%)
163
+ "
164
+ ` ;
165
+
143
166
exports [` c8 check-coverage allows --check-coverage when executing script 1` ] = `
144
167
",hey
145
168
i am a line of code
@@ -152,40 +175,40 @@ hey
152
175
--------------------------|---------|----------|---------|---------|--------------------------------
153
176
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
154
177
--------------------------|---------|----------|---------|---------|--------------------------------
155
- All files | 73.96 | 59.75 | 62.5 | 73.96 |
178
+ All files | 73.37 | 59.03 | 62.5 | 73.37 |
156
179
bin | 78.84 | 60 | 66.66 | 78.84 |
157
180
c8.js | 78.84 | 60 | 66.66 | 78.84 | 22,27-29,32-33,41-43,50-51
158
- lib | 77.19 | 54.38 | 72 | 77.19 |
181
+ lib | 77.88 | 54.38 | 72 | 77.88 |
159
182
is-cjs-esm-bridge.js | 90 | 25 | 100 | 90 | 9
160
- parse-args.js | 96.8 | 58.33 | 100 | 96.8 | 142-143,151-152,165-166
183
+ parse-args.js | 97.1 | 58.33 | 100 | 97.1 | 148-149,170-171,184-185
161
184
report.js | 75.31 | 58.33 | 78.57 | 75.31 | ...249,276-277,283-285,306-311
162
185
source-map-from-file.js | 45 | 100 | 0 | 45 | 39-50,52-67,69-77,81-98
163
- lib/commands | 46.23 | 75 | 16.66 | 46.23 |
164
- check-coverage.js | 21.31 | 100 | 0 | 21.31 | 9-11,14-27,30-44,46-61
165
- report.js | 93.75 | 71.42 | 50 | 93.75 | 9-10
186
+ lib/commands | 41.28 | 66.66 | 16.66 | 41.28 |
187
+ check-coverage.js | 18.84 | 100 | 0 | 18.84 | 9-11,14-35,38-52,54-69
188
+ report.js | 80 | 62.5 | 50 | 80 | 9-10,15-20
166
189
test/fixtures | 83.33 | 85.71 | 66.66 | 83.33 |
167
190
async.js | 100 | 100 | 100 | 100 |
168
191
normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20
169
192
--------------------------|---------|----------|---------|---------|--------------------------------
170
- ,ERROR: Coverage for lines (73.96 %) does not meet global threshold (101%)
171
- ERROR: Coverage for branches (59.75 %) does not meet global threshold (82%)
172
- ERROR: Coverage for statements (73.96 %) does not meet global threshold (95%)
193
+ ,ERROR: Coverage for lines (73.37 %) does not meet global threshold (101%)
194
+ ERROR: Coverage for branches (59.03 %) does not meet global threshold (82%)
195
+ ERROR: Coverage for statements (73.37 %) does not meet global threshold (95%)
173
196
"
174
197
` ;
175
198
176
199
exports [` c8 check-coverage allows threshold to be applied on per-file basis 1` ] = `
177
200
",,ERROR: Coverage for lines (78.84%) does not meet threshold (101%) for bin/c8.js
178
201
ERROR: Coverage for branches (60%) does not meet threshold (82%) for bin/c8.js
179
202
ERROR: Coverage for statements (78.84%) does not meet threshold (95%) for bin/c8.js
180
- ERROR: Coverage for lines (21.31 %) does not meet threshold (101%) for lib/commands/check-coverage.js
181
- ERROR: Coverage for statements (21.31 %) does not meet threshold (95%) for lib/commands/check-coverage.js
182
- ERROR: Coverage for lines (93.75 %) does not meet threshold (101%) for lib/commands/report.js
183
- ERROR: Coverage for branches (71.42 %) does not meet threshold (82%) for lib/commands/report.js
184
- ERROR: Coverage for statements (93.75 %) does not meet threshold (95%) for lib/commands/report.js
203
+ ERROR: Coverage for lines (18.84 %) does not meet threshold (101%) for lib/commands/check-coverage.js
204
+ ERROR: Coverage for statements (18.84 %) does not meet threshold (95%) for lib/commands/check-coverage.js
205
+ ERROR: Coverage for lines (80 %) does not meet threshold (101%) for lib/commands/report.js
206
+ ERROR: Coverage for branches (62.5 %) does not meet threshold (82%) for lib/commands/report.js
207
+ ERROR: Coverage for statements (80 %) does not meet threshold (95%) for lib/commands/report.js
185
208
ERROR: Coverage for lines (90%) does not meet threshold (101%) for lib/is-cjs-esm-bridge.js
186
209
ERROR: Coverage for branches (25%) does not meet threshold (82%) for lib/is-cjs-esm-bridge.js
187
210
ERROR: Coverage for statements (90%) does not meet threshold (95%) for lib/is-cjs-esm-bridge.js
188
- ERROR: Coverage for lines (96.8 %) does not meet threshold (101%) for lib/parse-args.js
211
+ ERROR: Coverage for lines (97.1 %) does not meet threshold (101%) for lib/parse-args.js
189
212
ERROR: Coverage for branches (58.33%) does not meet threshold (82%) for lib/parse-args.js
190
213
ERROR: Coverage for lines (75.31%) does not meet threshold (101%) for lib/report.js
191
214
ERROR: Coverage for branches (58.33%) does not meet threshold (82%) for lib/report.js
@@ -199,12 +222,20 @@ ERROR: Coverage for statements (75%) does not meet threshold (95%) for test/fixt
199
222
"
200
223
` ;
201
224
225
+ exports [` c8 check-coverage check-coverage command with --100 1` ] = `
226
+ ",,ERROR: Coverage for lines (77.22%) does not meet global threshold (100%)
227
+ ERROR: Coverage for functions (66.66%) does not meet global threshold (100%)
228
+ ERROR: Coverage for branches (62.35%) does not meet global threshold (100%)
229
+ ERROR: Coverage for statements (77.22%) does not meet global threshold (100%)
230
+ "
231
+ ` ;
232
+
202
233
exports [` c8 check-coverage exits with 0 if coverage within threshold 1` ] = ` ",,"` ;
203
234
204
235
exports [` c8 check-coverage exits with 1 if coverage is below threshold 1` ] = `
205
- ",,ERROR: Coverage for lines (73.96 %) does not meet global threshold (101%)
206
- ERROR: Coverage for branches (59.75 %) does not meet global threshold (82%)
207
- ERROR: Coverage for statements (73.96 %) does not meet global threshold (95%)
236
+ ",,ERROR: Coverage for lines (73.37 %) does not meet global threshold (101%)
237
+ ERROR: Coverage for branches (59.03 %) does not meet global threshold (82%)
238
+ ERROR: Coverage for statements (73.37 %) does not meet global threshold (95%)
208
239
"
209
240
` ;
210
241
@@ -287,17 +318,17 @@ exports[`c8 report generates report from existing temporary files 1`] = `
287
318
" ,--------------------------|---------|----------|---------|---------|--------------------------------
288
319
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
289
320
--------------------------|---------|----------|---------|---------|--------------------------------
290
- All files | 73.96 | 59.75 | 62.5 | 73.96 |
321
+ All files | 73.37 | 59.03 | 62.5 | 73.37 |
291
322
bin | 78.84 | 60 | 66.66 | 78.84 |
292
323
c8.js | 78.84 | 60 | 66.66 | 78.84 | 22,27-29,32-33,41-43,50-51
293
- lib | 77.19 | 54.38 | 72 | 77.19 |
324
+ lib | 77.88 | 54.38 | 72 | 77.88 |
294
325
is-cjs-esm-bridge.js | 90 | 25 | 100 | 90 | 9
295
- parse-args.js | 96.8 | 58.33 | 100 | 96.8 | 142-143,151-152,165-166
326
+ parse-args.js | 97.1 | 58.33 | 100 | 97.1 | 148-149,170-171,184-185
296
327
report.js | 75.31 | 58.33 | 78.57 | 75.31 | ...249,276-277,283-285,306-311
297
328
source-map-from-file.js | 45 | 100 | 0 | 45 | 39-50,52-67,69-77,81-98
298
- lib/commands | 46.23 | 75 | 16.66 | 46.23 |
299
- check-coverage.js | 21.31 | 100 | 0 | 21.31 | 9-11,14-27,30-44,46-61
300
- report.js | 93.75 | 71.42 | 50 | 93.75 | 9-10
329
+ lib/commands | 41.28 | 66.66 | 16.66 | 41.28 |
330
+ check-coverage.js | 18.84 | 100 | 0 | 18.84 | 9-11,14-35,38-52,54-69
331
+ report.js | 80 | 62.5 | 50 | 80 | 9-10,15-20
301
332
test/fixtures | 83.33 | 85.71 | 66.66 | 83.33 |
302
333
async.js | 100 | 100 | 100 | 100 |
303
334
normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20
@@ -309,24 +340,24 @@ exports[`c8 report supports --check-coverage, when generating reports 1`] = `
309
340
" ,--------------------------|---------|----------|---------|---------|--------------------------------
310
341
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
311
342
--------------------------|---------|----------|---------|---------|--------------------------------
312
- All files | 73.96 | 59.75 | 62.5 | 73.96 |
343
+ All files | 73.37 | 59.03 | 62.5 | 73.37 |
313
344
bin | 78.84 | 60 | 66.66 | 78.84 |
314
345
c8.js | 78.84 | 60 | 66.66 | 78.84 | 22,27-29,32-33,41-43,50-51
315
- lib | 77.19 | 54.38 | 72 | 77.19 |
346
+ lib | 77.88 | 54.38 | 72 | 77.88 |
316
347
is-cjs-esm-bridge.js | 90 | 25 | 100 | 90 | 9
317
- parse-args.js | 96.8 | 58.33 | 100 | 96.8 | 142-143,151-152,165-166
348
+ parse-args.js | 97.1 | 58.33 | 100 | 97.1 | 148-149,170-171,184-185
318
349
report.js | 75.31 | 58.33 | 78.57 | 75.31 | ...249,276-277,283-285,306-311
319
350
source-map-from-file.js | 45 | 100 | 0 | 45 | 39-50,52-67,69-77,81-98
320
- lib/commands | 46.23 | 75 | 16.66 | 46.23 |
321
- check-coverage.js | 21.31 | 100 | 0 | 21.31 | 9-11,14-27,30-44,46-61
322
- report.js | 93.75 | 71.42 | 50 | 93.75 | 9-10
351
+ lib/commands | 41.28 | 66.66 | 16.66 | 41.28 |
352
+ check-coverage.js | 18.84 | 100 | 0 | 18.84 | 9-11,14-35,38-52,54-69
353
+ report.js | 80 | 62.5 | 50 | 80 | 9-10,15-20
323
354
test/fixtures | 83.33 | 85.71 | 66.66 | 83.33 |
324
355
async.js | 100 | 100 | 100 | 100 |
325
356
normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20
326
357
--------------------------|---------|----------|---------|---------|--------------------------------
327
- ,ERROR: Coverage for lines (73.96 %) does not meet global threshold (101%)
328
- ERROR: Coverage for branches (59.75 %) does not meet global threshold (82%)
329
- ERROR: Coverage for statements (73.96 %) does not meet global threshold (95%)
358
+ ,ERROR: Coverage for lines (73.37 %) does not meet global threshold (101%)
359
+ ERROR: Coverage for branches (59.03 %) does not meet global threshold (82%)
360
+ ERROR: Coverage for statements (73.37 %) does not meet global threshold (95%)
330
361
"
331
362
`;
332
363
0 commit comments