Skip to content

Commit

Permalink
test: fix incorrect test fixture
Browse files Browse the repository at this point in the history
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: nodejs#47164
  • Loading branch information
cjihrig committed Mar 22, 2024
1 parent 0b67673 commit b7d0808
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/fixtures/test-runner/output/default_output.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const test = require('node:test');
test('should pass', () => {});
test('should fail', () => { throw new Error('fail'); });
test('should skip', { skip: true }, () => {});
test('parent', () => {
test('should fail', () => { throw new Error('fail'); });
test('should pass but parent fail', () => {});
test('parent', (t) => {
t.test('should fail', () => { throw new Error('fail'); });
t.test('should pass but parent fail', (t, done) => {
setImmediate(done);
});
});
10 changes: 10 additions & 0 deletions test/fixtures/test-runner/output/default_output.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m

[31m✖ should pass but parent fail [90m(*ms)[39m[39m
Expand Down Expand Up @@ -53,6 +58,11 @@
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m
*[39m

*
Expand Down

0 comments on commit b7d0808

Please sign in to comment.