Skip to content

fix: Windows compatibility for tests, scripts, and Vitest Explorer#876

Open
EhabY wants to merge 2 commits intomainfrom
fix/windows-cross-platform-compat
Open

fix: Windows compatibility for tests, scripts, and Vitest Explorer#876
EhabY wants to merge 2 commits intomainfrom
fix/windows-cross-platform-compat

Conversation

@EhabY
Copy link
Copy Markdown
Collaborator

@EhabY EhabY commented Apr 8, 2026

  • cross-env for npm scripts: Unix-style VAR=value syntax in npm scripts doesn't work on Windows. Added cross-env to build:production, test, test:extension, and test:webview scripts.
  • Vitest Explorer electron path: Changed vitest.nodeExecutable from node_modules/.bin/electron (doesn't exist on Windows, only electron.cmd does) to node_modules/electron/dist/electron which resolves cross-platform.
  • speedtest tests: execFile cannot spawn .cmd files on Windows (EINVAL). Replaced platform-specific .cmd/shell script creation with a unified approach using process.execPath to run echo-args.js directly on both platforms.
  • sshProcess tests: Path assertions used hardcoded forward slashes. Changed to path.join() so separators match the OS.
  • Integration test compilation: Added compile-tests:integration script and included it in the build step so the Mocha test explorer can discover integration tests after pnpm build.

@EhabY EhabY self-assigned this Apr 8, 2026
@EhabY EhabY force-pushed the fix/windows-cross-platform-compat branch from 65742a2 to 6c8b643 Compare April 9, 2026 09:11
EhabY added 2 commits April 9, 2026 14:18
…t electron path

Unix-style `VAR=value` syntax in npm scripts doesn't work on Windows.
Added cross-env to build:production, test, test:extension, and test:webview scripts.
Changed vitest.nodeExecutable to point to the actual electron binary instead of
the .bin shim, which doesn't resolve on Windows (only electron.cmd exists there).
- speedtest tests: use process.execPath instead of .cmd wrapper since
  execFile cannot spawn .cmd files on Windows (EINVAL)
- sshProcess tests: use path.join for expected log paths so separators
  match the OS (backslashes on Windows, forward slashes on Unix)
- Build integration tests on project build.
@EhabY EhabY force-pushed the fix/windows-cross-platform-compat branch from 2fa3b80 to 0121302 Compare April 9, 2026 11:19
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