fix: Windows compatibility for tests, scripts, and Vitest Explorer#876
Open
fix: Windows compatibility for tests, scripts, and Vitest Explorer#876
Conversation
65742a2 to
6c8b643
Compare
…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.
2fa3b80 to
0121302
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VAR=valuesyntax in npm scripts doesn't work on Windows. Addedcross-envtobuild:production,test,test:extension, andtest:webviewscripts.vitest.nodeExecutablefromnode_modules/.bin/electron(doesn't exist on Windows, onlyelectron.cmddoes) tonode_modules/electron/dist/electronwhich resolves cross-platform.execFilecannot spawn.cmdfiles on Windows (EINVAL). Replaced platform-specific.cmd/shell script creation with a unified approach usingprocess.execPathto runecho-args.jsdirectly on both platforms.path.join()so separators match the OS.compile-tests:integrationscript and included it in thebuildstep so the Mocha test explorer can discover integration tests afterpnpm build.