Skip to content

Commit 984e419

Browse files
rajbosCopilot
andcommitted
fix(mutation-tests): add inPlace:true to fix sandbox out/ directory issue
Stryker by default copies only git-tracked files to its sandbox. Since \out/\ is gitignored, the compiled test files and vscode-shim were missing from the sandbox, causing every test command to hang until Stryker's per-mutant timeout was reached. Setting inPlace:true makes Stryker mutate the compiled JS files directly in the working directory (no sandbox), which works correctly since npm run compile-tests already runs before npx stryker run. Stryker still backs up the originals in .stryker-tmp before each mutation and restores them afterwards. Verified locally: html.js run completed in 5s with 0 timeouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 113052a commit 984e419

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

vscode-extension/stryker.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ export default {
2121
].join(' '),
2222
},
2323

24+
// inPlace: true — Stryker mutates the compiled JS files directly in the
25+
// working directory instead of copying them to a sandbox. This is required
26+
// because the `out/` directory is gitignored and would be excluded from the
27+
// default sandbox, causing every test command to fail with MODULE_NOT_FOUND
28+
// and produce misleading "timed out" results.
29+
//
30+
// Tradeoff: if Stryker crashes mid-run, files in out/src/ are left in a
31+
// mutated state. Run `npm run compile-tests` to restore them.
32+
inPlace: true,
33+
2434
// Mutate compiled JS produced by `npm run compile-tests`.
2535
// The compiled tests in out/test/unit/ import from out/src/ via relative paths,
2636
// so mutating out/src/ is picked up by the test runner automatically.

0 commit comments

Comments
 (0)