Skip to content

Commit 96bbd51

Browse files
cjihrigmarco-ippolito
authored andcommitted
test: fix incorrect test fixture
This commit updates a test runner fixture that includes a failing child test. However, the nested test is created using the top level test() function instead t.test(). This commit updates the fixture to use t.test(), while preserving the expected failure. Refs: #47164 PR-URL: #52185 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent c0e5426 commit 96bbd51

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

test/fixtures/test-runner/output/default_output.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const test = require('node:test');
99
test('should pass', () => {});
1010
test('should fail', () => { throw new Error('fail'); });
1111
test('should skip', { skip: true }, () => {});
12-
test('parent', () => {
13-
test('should fail', () => { throw new Error('fail'); });
14-
test('should pass but parent fail', () => {});
12+
test('parent', (t) => {
13+
t.test('should fail', () => { throw new Error('fail'); });
14+
t.test('should pass but parent fail', (t, done) => {
15+
setImmediate(done);
16+
});
1517
});

test/fixtures/test-runner/output/default_output.snapshot

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
*[39m
1818
*[39m
1919
*[39m
20+
*[39m
21+
*[39m
22+
*[39m
23+
*[39m
24+
*[39m
2025
*[39m
2126

2227
[31m✖ should pass but parent fail [90m(*ms)[39m[39m
@@ -53,6 +58,11 @@
5358
*[39m
5459
*[39m
5560
*[39m
61+
*[39m
62+
*[39m
63+
*[39m
64+
*[39m
65+
*[39m
5666
*[39m
5767

5868
*

0 commit comments

Comments
 (0)