Skip to content

Commit

Permalink
test: migrate message v8 tests from Python to JS
Browse files Browse the repository at this point in the history
PR-URL: #50421
Fixes: #47707
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
  • Loading branch information
jahjahLemonade authored and targos committed Nov 23, 2023
1 parent ae93ed2 commit 982b576
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

require('../common');
require('../../common');

function AsmModule() {
'use asm';
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions test/parallel/test-node-output-v8-warning.mjs
Original file line number Diff line number Diff line change
@@ -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);
});
}
});

0 comments on commit 982b576

Please sign in to comment.