Skip to content

Commit ff2aea6

Browse files
Merge pull request #76 from koesie10/chdir
fix: chdir to parent cwd in child runner
2 parents 0c98dc1 + 112fca2 commit ff2aea6

File tree

1 file changed

+6
-1
lines changed
  • packages/jest-runner-vscode/src/child

1 file changed

+6
-1
lines changed

packages/jest-runner-vscode/src/child/runner.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ export async function run(): Promise<void> {
2323
)
2424

2525
try {
26-
const { PARENT_JEST_OPTIONS } = process.env
26+
const { PARENT_JEST_OPTIONS, PARENT_CWD } = process.env
2727

2828
if (!PARENT_JEST_OPTIONS) {
2929
throw new Error('PARENT_JEST_OPTIONS is not defined')
3030
}
31+
32+
if (PARENT_CWD) {
33+
process.chdir(PARENT_CWD)
34+
}
35+
3136
const options = JSON.parse(PARENT_JEST_OPTIONS) as RemoteTestOptions
3237
const jestOptions = [
3338
...options.args,

0 commit comments

Comments
 (0)