Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Jest running on Windows #8864

Merged
merged 1 commit into from Nov 21, 2022
Merged

Fix: Jest running on Windows #8864

merged 1 commit into from Nov 21, 2022

Conversation

SuperSodaSea
Copy link
Member

Description of change

Previously using npm test on Windows will report Error: spawn http-server ENOENT due to the difference on the shell between Windows and other Unix-like OS. Since I usually working on Windows, I modified the Jest setup & teardown script to make it working on Windows. Package tree-kill is introduced to properly kill the http-server on Windows, since process.kill() will only kill the shell but not the real http-server process.

See https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows for more details.

Pre-Merge Checklist
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

@SuperSodaSea SuperSodaSea added this to the v7.1.0 milestone Nov 19, 2022
Copy link
Member

@bigtimebuddy bigtimebuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bigtimebuddy bigtimebuddy added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Nov 19, 2022
@SuperSodaSea SuperSodaSea changed the title fix: Jest running on Windows Fix: Jest running on Windows Nov 19, 2022
@bigtimebuddy bigtimebuddy merged commit 1515d8d into dev Nov 21, 2022
@bigtimebuddy bigtimebuddy deleted the fix/jest-windows branch November 21, 2022 13:30
bigtimebuddy pushed a commit that referenced this pull request Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants