-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: migrate message v8 tests from Python to JS
PR-URL: #50421 Fixes: #47707 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
- Loading branch information
1 parent
12766fc
commit 65087c0
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
require('../../common'); | ||
|
||
function AsmModule() { | ||
'use asm'; | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
} | ||
}); |