-
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 eval tests from Python to JS
Migrate the eval tests in the `test/message` folder from Python to JS.
- Loading branch information
Yiyun Lei
committed
Oct 31, 2023
1 parent
aa4248d
commit d2536ce
Showing
5 changed files
with
59 additions
and
26 deletions.
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
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
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
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
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,29 @@ | ||
import '../common/index.mjs'; | ||
import * as fixtures from '../common/fixtures.mjs'; | ||
import * as snapshot from '../common/assertSnapshot.js'; | ||
import { describe, it } from 'node:test'; | ||
|
||
describe('eval output', { concurrency: true }, () => { | ||
function normalize(str) { | ||
return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '') | ||
.replaceAll(/\d+:\d+/g, '*:*'); | ||
} | ||
|
||
const defaultTransform = snapshot.transform( | ||
normalize, | ||
snapshot.replaceWindowsLineEndings, | ||
snapshot.replaceWindowsPaths, | ||
snapshot.replaceNodeVersion | ||
); | ||
|
||
const tests = [ | ||
{ name: 'eval/eval_messages.js' }, | ||
{ name: 'eval/stdin_messages.js' }, | ||
]; | ||
|
||
for (const { name } of tests) { | ||
it(name, async () => { | ||
await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform); | ||
Check failure on line 26 in test/parallel/test-node-output-eval.mjs GitHub Actions / test-macOS
Check failure on line 26 in test/parallel/test-node-output-eval.mjs GitHub Actions / test-linux
Check failure on line 26 in test/parallel/test-node-output-eval.mjs GitHub Actions / test-asan
|
||
}); | ||
} | ||
}); |