Skip to content

fix: use default child_process import so test stubs can intercept execFileSync#7

Merged
jsilvanus merged 1 commit into
mainfrom
claude/fix-ci-errors-s4kHW
Apr 11, 2026
Merged

fix: use default child_process import so test stubs can intercept execFileSync#7
jsilvanus merged 1 commit into
mainfrom
claude/fix-ci-errors-s4kHW

Conversation

@jsilvanus

Copy link
Copy Markdown
Owner

Named ESM imports (import { execFileSync } from 'child_process') are snapshots
and cannot be patched at runtime via the module.exports object. The grid-search
test stub (child_process.execFileSync = () => {}) only works through the default
import's live binding. Switching to import childProcess from 'child_process'
and calling childProcess.execFileSync(...) makes the stub effective and prevents
the real grid-search subprocess from running in CI where network is blocked.

https://claude.ai/code/session_01WKLNCnwF2psdSJc8291RWr

…cFileSync

Named ESM imports (`import { execFileSync } from 'child_process'`) are snapshots
and cannot be patched at runtime via the module.exports object. The grid-search
test stub (`child_process.execFileSync = () => {}`) only works through the default
import's live binding. Switching to `import childProcess from 'child_process'`
and calling `childProcess.execFileSync(...)` makes the stub effective and prevents
the real grid-search subprocess from running in CI where network is blocked.

https://claude.ai/code/session_01WKLNCnwF2psdSJc8291RWr
@jsilvanus jsilvanus merged commit fd41754 into main Apr 11, 2026
1 of 3 checks passed
@jsilvanus jsilvanus deleted the claude/fix-ci-errors-s4kHW branch April 14, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants