Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix jest wrapper #27636

Merged
merged 6 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/exec-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function execSnapshot(cmd: string, options?: RawExecOptions): ExecSnapshot {
if (is.string(v)) {
const val = v
.replace(regEx(/\\(\w)/g), '/$1')
.replace(regEx(/^[A-Z]:\//), '/') // replace windows paths
.replace(regEx(/"[A-Z]:\//g), '"/') // replace windows paths
.replace(cwd, '/root/project');
this.update(val);
}
Expand Down
6 changes: 5 additions & 1 deletion tools/jest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ args.push('node_modules/jest/bin/jest.js', '--logHeapUsage');
// add other args after `node tools/jest.mjs`
args.push(...argv.slice(2));

spawnSync('node', args, { stdio: 'inherit', env });
const res = spawnSync('node', args, { stdio: 'inherit', env });

if (res.status !== null && res.status !== 0) {
process.exit(res.status);
}