@@ -19,6 +19,7 @@ function generateReport(report) {
19
19
}
20
20
21
21
const flags = [
22
+ '--enable-source-maps' ,
22
23
'--test' , '--experimental-test-coverage' , '--test-reporter' , 'tap' ,
23
24
] ;
24
25
@@ -40,6 +41,28 @@ describe('Coverage with source maps', async () => {
40
41
const spawned = await common . spawnPromisified ( process . execPath , flags , {
41
42
cwd : fixtures . path ( 'test-runner' , 'coverage' )
42
43
} ) ;
44
+
45
+ t . assert . strictEqual ( spawned . stderr , '' ) ;
46
+ t . assert . ok ( spawned . stdout . includes ( report ) ) ;
47
+ t . assert . strictEqual ( spawned . code , 1 ) ;
48
+ } ) ;
49
+
50
+ await it ( 'should only work with --enable-source-maps' , async ( t ) => {
51
+ const report = generateReport ( [
52
+ '# --------------------------------------------------------------' ,
53
+ '# file | line % | branch % | funcs % | uncovered lines' ,
54
+ '# --------------------------------------------------------------' ,
55
+ '# a.test.mjs | 100.00 | 100.00 | 100.00 | ' ,
56
+ '# index.test.js | 71.43 | 66.67 | 100.00 | 6-7' ,
57
+ '# stdin.test.js | 100.00 | 100.00 | 100.00 | ' ,
58
+ '# --------------------------------------------------------------' ,
59
+ '# all files | 85.71 | 87.50 | 100.00 | ' ,
60
+ '# --------------------------------------------------------------' ,
61
+ ] ) ;
62
+
63
+ const spawned = await common . spawnPromisified ( process . execPath , flags . slice ( 1 ) , {
64
+ cwd : fixtures . path ( 'test-runner' , 'coverage' )
65
+ } ) ;
43
66
t . assert . strictEqual ( spawned . stderr , '' ) ;
44
67
t . assert . ok ( spawned . stdout . includes ( report ) ) ;
45
68
t . assert . strictEqual ( spawned . code , 1 ) ;
0 commit comments