Skip to content

Commit 26bd605

Browse files
committed
updated test
1 parent 48a8507 commit 26bd605

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-runner-watch-coverage.mjs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Flags: --expose-internals
22
import * as common from '../common/index.mjs';
3-
import { describe, it } from 'node:test';
3+
import { test } from 'node:test';
44
import { spawn } from 'node:child_process';
55
import { writeFileSync } from 'node:fs';
66
import util from 'internal/util';
@@ -53,7 +53,8 @@ Object.entries(fixtureContent)
5353
async function testWatch({ fileToUpdate, file }) {
5454
const ran1 = util.createDeferredPromise();
5555
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];
5758
const child = spawn(process.execPath,
5859
args.filter(Boolean),
5960
{ encoding: 'utf8', stdio: 'pipe', cwd: tmpdir.path });
@@ -76,9 +77,8 @@ async function testWatch({ fileToUpdate, file }) {
7677
return stdout;
7778
}
7879

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));
8484
});

0 commit comments

Comments
 (0)