Skip to content

Commit 92a153e

Browse files
jahjahLemonadeUlisesGascon
authored andcommitted
test: migrate message v8 tests from Python to JS
PR-URL: #50421Fixes: #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
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

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

55
functionAsmModule(){
66
'use asm';
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import'../common/index.mjs';
2+
import*asfixturesfrom'../common/fixtures.mjs';
3+
import*assnapshotfrom'../common/assertSnapshot.js';
4+
import{describe,it}from'node:test';
5+
6+
functionreplaceNodeVersion(str){
7+
returnstr.replaceAll(process.version,'*');
8+
}
9+
10+
describe('v8 output',{concurrency: true},()=>{
11+
functionnormalize(str){
12+
returnstr.replaceAll(snapshot.replaceWindowsPaths(process.cwd()),'')
13+
.replaceAll(/:\d+/g,':*')
14+
.replaceAll('/','*')
15+
.replaceAll('*test*','*')
16+
.replaceAll('*fixtures*v8*','*')
17+
.replaceAll('node --','* --');
18+
}
19+
constcommon=snapshot
20+
.transform(snapshot.replaceWindowsLineEndings,snapshot.replaceWindowsPaths,replaceNodeVersion);
21+
constdefaultTransform=snapshot.transform(common,normalize);
22+
consttests=[
23+
{name: 'v8/v8_warning.js'},
24+
];
25+
for(const{ name }oftests){
26+
it(name,async()=>{
27+
awaitsnapshot.spawnAndAssert(fixtures.path(name),defaultTransform);
28+
});
29+
}
30+
});

0 commit comments

Comments
(0)