Skip to content

Commit

Permalink
test: fix jest wrapper (#27636)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Feb 29, 2024
1 parent a9bb5b9 commit 3d2cabb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/exec-util.ts
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
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);
}

0 comments on commit 3d2cabb

Please sign in to comment.