From ab08a39aeca34b51214f9b50cdb3d8f4f67a163d Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 21 Mar 2024 20:54:57 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/47164 PR-URL: https://github.com/nodejs/node/pull/52185 Reviewed-By: Luigi Pinca Reviewed-By: Chemi Atlow --- test/fixtures/test-runner/output/default_output.js | 8 +++++--- .../test-runner/output/default_output.snapshot | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/test/fixtures/test-runner/output/default_output.js b/test/fixtures/test-runner/output/default_output.js index b0392f3737b1d6..3bb85c781ba7b1 100644 --- a/test/fixtures/test-runner/output/default_output.js +++ b/test/fixtures/test-runner/output/default_output.js @@ -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); + }); }); diff --git a/test/fixtures/test-runner/output/default_output.snapshot b/test/fixtures/test-runner/output/default_output.snapshot index b003f9299c4418..d91db3bd9e54fe 100644 --- a/test/fixtures/test-runner/output/default_output.snapshot +++ b/test/fixtures/test-runner/output/default_output.snapshot @@ -17,6 +17,11 @@ *[39m *[39m *[39m + *[39m + *[39m + *[39m + *[39m + *[39m *[39m [31m✖ should pass but parent fail [90m(*ms)[39m[39m @@ -53,6 +58,11 @@ *[39m *[39m *[39m + *[39m + *[39m + *[39m + *[39m + *[39m *[39m *