From de85e12779bd04767d788fcdd50b71e5d3e5a48b Mon Sep 17 00:00:00 2001 From: galaxy4276 Date: Sat, 18 Apr 2026 21:35:25 +0900 Subject: [PATCH] test: migrate console_assert message test to snapshot Migrate test/message/console_assert from the legacy Python-based test runner to the JS snapshot approach used by test-node-output-console.mjs. The new fixture runs console.assert(false, Symbol('hello')) and compares against a snapshot, removing the dependency on testcfg.py and the .out file pattern. Refs: #47707 Co-Authored-By: Claude Sonnet 4.6 --- test/{message => fixtures/console}/console_assert.js | 2 +- test/fixtures/console/console_assert.snapshot | 1 + test/message/console_assert.out | 1 - test/parallel/test-node-output-console.mjs | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) rename test/{message => fixtures/console}/console_assert.js (69%) create mode 100644 test/fixtures/console/console_assert.snapshot delete mode 100644 test/message/console_assert.out diff --git a/test/message/console_assert.js b/test/fixtures/console/console_assert.js similarity index 69% rename from test/message/console_assert.js rename to test/fixtures/console/console_assert.js index 14976312820d40..1b2d4697e4cbae 100644 --- a/test/message/console_assert.js +++ b/test/fixtures/console/console_assert.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +require('../../common'); console.assert(false, Symbol('hello')); diff --git a/test/fixtures/console/console_assert.snapshot b/test/fixtures/console/console_assert.snapshot new file mode 100644 index 00000000000000..733ef609b71a80 --- /dev/null +++ b/test/fixtures/console/console_assert.snapshot @@ -0,0 +1 @@ +Assertion failed Symbol(hello) diff --git a/test/message/console_assert.out b/test/message/console_assert.out deleted file mode 100644 index 259d18fa5cfc2f..00000000000000 --- a/test/message/console_assert.out +++ /dev/null @@ -1 +0,0 @@ -Assertion failed* Symbol(hello) diff --git a/test/parallel/test-node-output-console.mjs b/test/parallel/test-node-output-console.mjs index e9b001db336cf5..d29cc16e2df2e2 100644 --- a/test/parallel/test-node-output-console.mjs +++ b/test/parallel/test-node-output-console.mjs @@ -9,6 +9,7 @@ const skipForceColors = describe('console output', { concurrency: !process.env.TEST_PARALLEL }, () => { const tests = [ + { name: 'console/console_assert.js' }, { name: 'console/2100bytes.js' }, { name: 'console/console_low_stack_space.js' }, { name: 'console/console.js' },