Skip to content

test: mock package manager subprocess in provider tests - #9

Open
LittleSound wants to merge 3 commits into
mainfrom
test/mock-install-in-provider-tests
Open

LittleSound wants to merge 3 commits into
mainfrom
test/mock-install-in-provider-tests

Conversation

@LittleSound

@LittleSound LittleSound commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Includes #8 (c71dc9e). Merging this lands both; #8 is red on Windows only because its real-install tests time out, which this PR removes.

Summary

  • depInstallExecutor tests in bun/npm/pnpm/vlt/yarn ran a real <pm> install against the registry, causing 5s timeouts on slow CI runners (the recurring Unit Test failures on main). They now mock runCommand and assert it was called with the expected command/args/cwd; file-write assertions unchanged.
  • Ignore .claude/ in .gitignore and vitest (local agent worktrees were picked up by eslint/vitest).

Testing

  • Full suite passes with no package manager on PATH (239/239, ~0.7s); slowest provider test went from ~17s to ~17ms.
  • pnpm run lint, pnpm run typecheck ✓

Package managers such as pnpm, npm and yarn are installed as .cmd shims on Windows, which node:child_process cannot resolve without a shell, causing 'spawnSync pnpm ENOENT'. Route all provider spawns through a runCommand helper backed by cross-spawn, which resolves shims and escapes arguments without enabling shell: true.

Closes #7
@LittleSound
LittleSound changed the base branch from fix/windows-spawn-enoent to main October 20, 2026 07:21
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.

1 participant