Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: chdir to parent cwd in child runner
When using the runner on Windows, the cwd of the child process seems to be the directory where `code.exe` is located, rather than the directory where it was started. On Linux and macOS, the cwd is correctly set to the directory from which Jest was launched. To ensure consistency between platforms, this fix will always set the child process' cwd to the cwd of the parent. This is mostly to fix an issue where `runCLI` within the child process cannot find a passed `--config` path since the cwd doesn't match what's expected by Jest. This can be replicated by running the following: ```shell cd e2e/passing-tests yarn jest --config ../passing-tests/jest.config.js ``` This will work on Linux and macOS, but will not work on Windows before this fix. After this fix, it will work correctly.
- Loading branch information