Skip to content

Commit

Permalink
Merge pull request #76 from koesie10/chdir
Browse files Browse the repository at this point in the history
fix: chdir to parent cwd in child runner
  • Loading branch information
adalinesimonian authored Dec 26, 2024
2 parents 0c98dc1 + 112fca2 commit ff2aea6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/jest-runner-vscode/src/child/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ export async function run(): Promise<void> {
)

try {
const { PARENT_JEST_OPTIONS } = process.env
const { PARENT_JEST_OPTIONS, PARENT_CWD } = process.env

if (!PARENT_JEST_OPTIONS) {
throw new Error('PARENT_JEST_OPTIONS is not defined')
}

if (PARENT_CWD) {
process.chdir(PARENT_CWD)
}

const options = JSON.parse(PARENT_JEST_OPTIONS) as RemoteTestOptions
const jestOptions = [
...options.args,
Expand Down

0 comments on commit ff2aea6

Please sign in to comment.