1
1
// Flags: --expose-internals
2
2
import * as common from '../common/index.mjs' ;
3
- import { describe , it } from 'node:test' ;
3
+ import { test } from 'node:test' ;
4
4
import { spawn } from 'node:child_process' ;
5
5
import { writeFileSync } from 'node:fs' ;
6
6
import util from 'internal/util' ;
@@ -53,7 +53,8 @@ Object.entries(fixtureContent)
53
53
async function testWatch ( { fileToUpdate, file } ) {
54
54
const ran1 = util . createDeferredPromise ( ) ;
55
55
const ran2 = util . createDeferredPromise ( ) ;
56
- const args = [ '--test' , '--watch' , '--experimental-test-coverage' , file ? fixturePaths [ file ] : undefined ] ;
56
+ const args = [ '--test' , '--watch' , '--experimental-test-coverage' ,
57
+ '--test-reporter' , 'tap' , file ? fixturePaths [ file ] : undefined ] ;
57
58
const child = spawn ( process . execPath ,
58
59
args . filter ( Boolean ) ,
59
60
{ encoding : 'utf8' , stdio : 'pipe' , cwd : tmpdir . path } ) ;
@@ -76,9 +77,8 @@ async function testWatch({ fileToUpdate, file }) {
76
77
return stdout ;
77
78
}
78
79
79
- describe ( 'test runner must report coverage report with watch mode' , ( ) => {
80
- it ( 'should report coverage report with watch mode' , async ( ) => {
81
- const stdout = await testWatch ( { file : 'test.js' , fileToUpdate : 'test.js' } ) ;
82
- assert ( stdout . includes ( getCoverageFixtureReport ( 'tap' ) ) ) ;
83
- } ) ;
80
+ test ( 'should report coverage report with watch mode' , async ( ) => {
81
+ const stdout = await testWatch ( { file : 'test.js' , fileToUpdate : 'test.js' } ) ;
82
+ const expectedCoverageReport = getCoverageFixtureReport ( ) ;
83
+ assert ( stdout . includes ( expectedCoverageReport ) ) ;
84
84
} ) ;
0 commit comments