/
integration.js.snap
463 lines (430 loc) · 21.8 KB
/
integration.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`c8 /* c8 ignore next */ ignores lines with special comment 1`] = `
",covered
covered
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 86.21 | 91.67 | 66.67 | 86.21 |
async.js | 100 | 100 | 100 | 100 |
c8-ignore-next.js | 90.91 | 100 | 100 | 90.91 | 21-22
normal.js | 75 | 66.67 | 33.33 | 75 | 14-16,18-20
-------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 --all reports coverage for unloaded js files as 0 for line, branch and function 1`] = `
",zero
positive
negative
--------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------|---------|----------|---------|---------|-------------------
All files | 64.29 | 66.67 | 50 | 64.29 |
vanilla | 78.26 | 75 | 100 | 78.26 |
loaded.js | 73.68 | 71.43 | 100 | 73.68 | 4-5,16-18
main.js | 100 | 100 | 100 | 100 |
vanilla/dir | 0 | 0 | 0 | 0 |
unloaded.js | 0 | 0 | 0 | 0 | 1-5
--------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 --all reports coverage for unloaded transpiled ts files as 0 for line, branch and function 1`] = `
",zero
positive
negative
-----------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------|---------|----------|---------|---------|-------------------
All files | 64.29 | 66.67 | 50 | 64.29 |
ts-compiled | 78.26 | 75 | 100 | 78.26 |
loaded.ts | 73.68 | 71.43 | 100 | 73.68 | 4-5,16-18
main.ts | 100 | 100 | 100 | 100 |
ts-compiled/dir | 0 | 0 | 0 | 0 |
unloaded.ts | 0 | 0 | 0 | 0 | 1-5
-----------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 --all reports coverage for unloaded ts files as 0 for line, branch and function when using ts-node 1`] = `
",zero
positive
negative
--------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------|---------|----------|---------|---------|-------------------
All files | 64.29 | 66.67 | 50 | 64.29 |
ts-only | 78.26 | 75 | 100 | 78.26 |
loaded.ts | 73.68 | 71.43 | 100 | 73.68 | 4-5,16-18
main.ts | 100 | 100 | 100 | 100 |
ts-only/dir | 0 | 0 | 0 | 0 |
unloaded.ts | 0 | 0 | 0 | 0 | 1-5
--------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 --all should allow for --all to be used in conjunction with --check-coverage 1`] = `
",zero
positive
negative
--------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------|---------|----------|---------|---------|-------------------
All files | 64.29 | 66.67 | 50 | 64.29 |
vanilla | 78.26 | 75 | 100 | 78.26 |
loaded.js | 73.68 | 71.43 | 100 | 73.68 | 4-5,16-18
main.js | 100 | 100 | 100 | 100 |
vanilla/dir | 0 | 0 | 0 | 0 |
unloaded.js | 0 | 0 | 0 | 0 | 1-5
--------------|---------|----------|---------|---------|-------------------
,ERROR: Coverage for lines (64.29%) does not meet global threshold (100%)
ERROR: Coverage for branches (66.67%) does not meet global threshold (82%)
ERROR: Coverage for statements (64.29%) does not meet global threshold (96%)
"
`;
exports[`c8 --all should allow for --all to be used with the check-coverage command (2 invocations) 1`] = `
",,ERROR: Coverage for lines (64.29%) does not meet global threshold (90%)
ERROR: Coverage for branches (66.67%) does not meet global threshold (82%)
ERROR: Coverage for statements (64.29%) does not meet global threshold (96%)
"
`;
exports[`c8 ESM Modules collects coverage for ESM modules 1`] = `
",bar foo
------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------|---------|----------|---------|---------|-------------------
All files | 83.33 | 100 | 66.67 | 83.33 |
export.cjs | 100 | 100 | 100 | 100 |
export.mjs | 71.43 | 100 | 50 | 71.43 | 2-3
import.mjs | 100 | 100 | 100 | 100 |
------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 can allow for files outside of cwd 1`] = `
",hi
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
multidir1 | 100 | 100 | 100 | 100 |
file1.js | 100 | 100 | 100 | 100 |
report | 100 | 100 | 100 | 100 |
allowExternal.js | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 check-coverage allows --check-coverage when executing script 1`] = `
",hey
i am a line of code
what
hey
what
hey
what
hey
-----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files | 83.33 | 85.71 | 60 | 83.33 |
async.js | 100 | 100 | 100 | 100 |
normal.js | 75 | 66.67 | 33.33 | 75 | 14-16,18-20
-----------|---------|----------|---------|---------|-------------------
,ERROR: Coverage for lines (83.33%) does not meet global threshold (101%)
ERROR: Coverage for statements (83.33%) does not meet global threshold (96%)
"
`;
exports[`c8 check-coverage allows threshold to be applied on per-file basis 1`] = `
",,ERROR: Coverage for lines (100%) does not meet threshold (101%) for test/fixtures/async.js
ERROR: Coverage for lines (75%) does not meet threshold (101%) for test/fixtures/normal.js
ERROR: Coverage for branches (66.67%) does not meet threshold (82%) for test/fixtures/normal.js
ERROR: Coverage for statements (75%) does not meet threshold (96%) for test/fixtures/normal.js
"
`;
exports[`c8 check-coverage exits with 0 if coverage within threshold 1`] = `",,"`;
exports[`c8 check-coverage exits with 1 if coverage is below threshold 1`] = `
",,ERROR: Coverage for lines (83.33%) does not meet global threshold (101%)
ERROR: Coverage for statements (83.33%) does not meet global threshold (96%)
"
`;
exports[`c8 cobertura report escapes special characters 1`] = `
"<?xml version=\\"1.0\\" ?>
<!DOCTYPE coverage SYSTEM \\"http://cobertura.sourceforge.net/xml/coverage-04.dtd\\">
<coverage lines-valid=\\"15\\" lines-covered=\\"15\\" line-rate=\\"1\\" branches-valid=\\"4\\" branches-covered=\\"4\\" branch-rate=\\"1\\" timestamp=\\"nnnn\\" complexity=\\"0\\" version=\\"0.1\\">
<sources>
<source>/foo/file</source>
</sources>
<packages>
<class name=\\"computed-method.js\\" filename=\\"test/fixtures/computed-method.js\\" line-rate=\\"1\\" branch-rate=\\"1\\">
<methods>
<method name=\\"Test\\" hits=\\"1\\" signature=\\"()V\\">
<lines>
<line number=\\"2\\" hits=\\"1\\"/>
</lines>
</method>
<method name=\\"run\\" hits=\\"1\\" signature=\\"()V\\">
<lines>
<line number=\\"6\\" hits=\\"1\\"/>
</lines>
</method>
<method name=\\"map.<computed>.f\\" hits=\\"1\\" signature=\\"()V\\">
<lines>
<line number=\\"8\\" hits=\\"1\\"/>
</lines>
</method>
</methods>
<lines>
<line number=\\"1\\" hits=\\"1\\" branch=\\"true\\" condition-coverage=\\"100% (1/1)\\"/>
<line number=\\"2\\" hits=\\"1\\" branch=\\"true\\" condition-coverage=\\"100% (1/1)\\"/>
<line number=\\"3\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"4\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"5\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"6\\" hits=\\"1\\" branch=\\"true\\" condition-coverage=\\"100% (1/1)\\"/>
<line number=\\"7\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"8\\" hits=\\"1\\" branch=\\"true\\" condition-coverage=\\"100% (1/1)\\"/>
<line number=\\"9\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"10\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"11\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"12\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"13\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"14\\" hits=\\"1\\" branch=\\"false\\"/>
<line number=\\"15\\" hits=\\"1\\" branch=\\"false\\"/>
</lines>
</class>
</packages>
</coverage>
"
`;
exports[`c8 merges reports from subprocesses together 1`] = `
",first
second
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
multiple-spawn.js | 100 | 100 | 100 | 100 |
subprocess.js | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 report generates report from existing temporary files 1`] = `
",-----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files | 83.33 | 85.71 | 60 | 83.33 |
async.js | 100 | 100 | 100 | 100 |
normal.js | 75 | 66.67 | 33.33 | 75 | 14-16,18-20
-----------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 report supports --check-coverage, when generating reports 1`] = `
",-----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files | 83.33 | 85.71 | 60 | 83.33 |
async.js | 100 | 100 | 100 | 100 |
normal.js | 75 | 66.67 | 33.33 | 75 | 14-16,18-20
-----------|---------|----------|---------|---------|-------------------
,ERROR: Coverage for lines (83.33%) does not meet global threshold (101%)
ERROR: Coverage for statements (83.33%) does not meet global threshold (96%)
"
`;
exports[`c8 report supports reporting on directories outside cwd 1`] = `
",-----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
multidir1 | 0 | 0 | 0 | 0 |
file1.js | 0 | 0 | 0 | 0 | 1
multidir2 | 0 | 0 | 0 | 0 |
file2.js | 0 | 0 | 0 | 0 | 1
-----------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 report supports reporting on single directories outside cwd 1`] = `
",----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
file1.js | 0 | 0 | 0 | 0 | 1
----------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 reports coverage for script that exits normally 1`] = `
",hey
i am a line of code
what
hey
what
hey
what
hey
-----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files | 83.33 | 85.71 | 60 | 83.33 |
async.js | 100 | 100 | 100 | 100 |
normal.js | 75 | 66.67 | 33.33 | 75 | 14-16,18-20
-----------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 should allow for files outside of cwd 1`] = `
",hi
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
multidir1 | 100 | 100 | 100 | 100 |
file1.js | 100 | 100 | 100 | 100 |
report | 100 | 100 | 100 | 100 |
allowExternal.js | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 should allow for multiple overrides of src location for --all 1`] = `
",hihi
--------------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------------------|---------|----------|---------|---------|-------------------
All files | 3.57 | 16.67 | 0 | 3.57 |
multidir1 | 0 | 0 | 0 | 0 |
file1.js | 0 | 0 | 0 | 0 | 1
multidir2 | 0 | 0 | 0 | 0 |
file2.js | 0 | 0 | 0 | 0 | 1
report | 3.85 | 25 | 0 | 3.85 |
allowExternal.js | 0 | 0 | 0 | 0 | 1
report-multi-dir-external.js | 0 | 0 | 0 | 0 | 1-12
report-single-dir-external.js | 0 | 0 | 0 | 0 | 1-12
srcOverride.js | 100 | 100 | 100 | 100 |
--------------------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps TypeScript remaps branches 1`] = `
",reachable
a = true
a = false
------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------------|---------|----------|---------|---------|-------------------
All files | 84 | 57.14 | 100 | 84 |
branches.typescript.ts | 84 | 57.14 | 100 | 84 | 7,11-12,18
------------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps TypeScript remaps classes 1`] = `
",covered
covered
covered
covered
covered
-----------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------------|---------|----------|---------|---------|-------------------
All files | 81.82 | 87.5 | 60 | 81.82 |
classes.typescript.ts | 81.82 | 87.5 | 60 | 81.82 | 12-13,21-22,27-28
-----------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps UglifyJS remaps branches 1`] = `
",reachable
a = true
a = false
-------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------|---------|----------|---------|---------|-------------------
All files | 80 | 50 | 100 | 80 |
branches.js | 80 | 50 | 100 | 80 | 2,5-6,13
-------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps UglifyJS remaps classes 1`] = `
",covered
covered
covered
covered
covered
------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------|---------|----------|---------|---------|-------------------
All files | 85.19 | 83.33 | 60 | 85.19 |
classes.js | 85.19 | 83.33 | 60 | 85.19 | 6-7,15,21
------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps does not attempt to load source map URLs that aren't 1`] = `
",--------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------|---------|----------|---------|---------|-------------------
All files | 71.43 | 50 | 100 | 71.43 |
fake-source-map.js | 71.43 | 50 | 100 | 71.43 | 5-6
--------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps nyc remaps branches 1`] = `
",reachable
a = true
a = false
-------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------|---------|----------|---------|---------|-------------------
All files | 70 | 44.44 | 100 | 70 |
branches.js | 70 | 44.44 | 100 | 70 | 2,4-7,13
-------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps nyc remaps classes 1`] = `
",covered
covered
covered
covered
covered
------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------|---------|----------|---------|---------|-------------------
All files | 70.37 | 66.67 | 60 | 70.37 |
classes.js | 70.37 | 66.67 | 60 | 70.37 | 5-8,15-16,21-22
------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 source-maps ts-node reads source-map from cache, and applies to coverage 1`] = `
",covered
covered
covered
covered
covered
------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------|---------|----------|---------|---------|-------------------
All files | 88.24 | 87.5 | 80 | 88.24 |
ts-node-basic.ts | 88.24 | 87.5 | 80 | 88.24 | 12-13,28-29
------------------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 supports exeternally set NODE_V8_COVERAGE 1`] = `
",hey
i am a line of code
what
hey
what
hey
what
hey
-----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------|---------|----------|---------|---------|-------------------
All files | 83.33 | 85.71 | 60 | 83.33 |
async.js | 100 | 100 | 100 | 100 |
normal.js | 75 | 66.67 | 33.33 | 75 | 14-16,18-20
-----------|---------|----------|---------|---------|-------------------
,"
`;
exports[`c8 ts-node reads source-map from cache, and applies to coverage 1`] = `
",covered
covered
covered
covered
covered
------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------|---------|----------|---------|---------|-------------------
All files | 88.24 | 87.5 | 80 | 88.24 |
ts-node-basic.ts | 88.24 | 87.5 | 80 | 88.24 | 12-13,28-29
------------------|---------|----------|---------|---------|-------------------
,"
`;