Skip to content

Commit 92a153e

Browse files
jahjahLemonadeUlisesGascon
authored andcommitted
test: migrate message v8 tests from Python to JS
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]>
1 parent 34a789d commit 92a153e

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

test/message/v8_warning.js test/fixtures/v8/v8_warning.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
require('../common');
3+
require('../../common');
44

55
function AsmModule() {
66
'use asm';
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import '../common/index.mjs';
2+
import * as fixtures from '../common/fixtures.mjs';
3+
import * as snapshot from '../common/assertSnapshot.js';
4+
import { describe, it } from 'node:test';
5+
6+
function replaceNodeVersion(str) {
7+
return str.replaceAll(process.version, '*');
8+
}
9+
10+
describe('v8 output', { concurrency: true }, () => {
11+
function normalize(str) {
12+
return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '')
13+
.replaceAll(/:\d+/g, ':*')
14+
.replaceAll('/', '*')
15+
.replaceAll('*test*', '*')
16+
.replaceAll('*fixtures*v8*', '*')
17+
.replaceAll('node --', '* --');
18+
}
19+
const common = snapshot
20+
.transform(snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, replaceNodeVersion);
21+
const defaultTransform = snapshot.transform(common, normalize);
22+
const tests = [
23+
{ name: 'v8/v8_warning.js' },
24+
];
25+
for (const { name } of tests) {
26+
it(name, async () => {
27+
await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform);
28+
});
29+
}
30+
});

0 commit comments

Comments
 (0)