diff --git a/test/exec-util.ts b/test/exec-util.ts index 9b73c3079faeb3fd25559485a46db409ccf2afa6..4fd8870092aa84ec98c6cbae920cac81d859ea02 100644 --- a/test/exec-util.ts +++ b/test/exec-util.ts @@ -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); } diff --git a/tools/jest.mjs b/tools/jest.mjs index 232e249657c2acf356b564e25ac92f81dca321f5..914cf82b36b106c6c0eebe39de6b20cd0c211abe 100644 --- a/tools/jest.mjs +++ b/tools/jest.mjs @@ -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); +}