diff --git a/test/message/v8_warning.js b/test/fixtures/v8/v8_warning.js similarity index 89% rename from test/message/v8_warning.js rename to test/fixtures/v8/v8_warning.js index d7d1c5e7dbdff6..ab4d2bf305823f 100644 --- a/test/message/v8_warning.js +++ b/test/fixtures/v8/v8_warning.js @@ -1,6 +1,6 @@ 'use strict'; -require('../common'); +require('../../common'); function AsmModule() { 'use asm'; diff --git a/test/message/v8_warning.out b/test/fixtures/v8/v8_warning.snapshot similarity index 100% rename from test/message/v8_warning.out rename to test/fixtures/v8/v8_warning.snapshot diff --git a/test/parallel/test-node-output-v8-warning.mjs b/test/parallel/test-node-output-v8-warning.mjs new file mode 100644 index 00000000000000..7278a03ce178e7 --- /dev/null +++ b/test/parallel/test-node-output-v8-warning.mjs @@ -0,0 +1,30 @@ +import '../common/index.mjs'; +import * as fixtures from '../common/fixtures.mjs'; +import * as snapshot from '../common/assertSnapshot.js'; +import { describe, it } from 'node:test'; + +function replaceNodeVersion(str) { + return str.replaceAll(process.version, '*'); +} + +describe('v8 output', { concurrency: true }, () => { + function normalize(str) { + return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '') + .replaceAll(/:\d+/g, ':*') + .replaceAll('/', '*') + .replaceAll('*test*', '*') + .replaceAll('*fixtures*v8*', '*') + .replaceAll('node --', '* --'); + } + const common = snapshot + .transform(snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, replaceNodeVersion); + const defaultTransform = snapshot.transform(common, normalize); + const tests = [ + { name: 'v8/v8_warning.js' }, + ]; + for (const { name } of tests) { + it(name, async () => { + await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform); + }); + } +});