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 tests on Windows in node10 branch #307

Merged
merged 1 commit into from
May 7, 2018
Merged

Fix tests on Windows in node10 branch #307

merged 1 commit into from
May 7, 2018

Conversation

zenflow
Copy link

@zenflow zenflow commented May 7, 2018

Fix tests on Windows by avoiding bug in spawn-wrap by using spawnSync instead of execSync

I didn't get to the root of the problem, but I think I've proven that the failing test was due to a bug in tap, probably coming from 'spawn-wrap' (a dependency of 'nyc', which is a dependency of 'tap'); both versions of the changed code should give the same results, but nah.

In my experiments I found that a number of things would make the tests pass (each on their own):

  • Run npm test from Hyper terminal instead of Webstorm IDE's terminal or the normal Windows terminal (most confusing, since they all use the cmd.exe shell, and the environment variables were the exact same)
  • disable coverage
  • set nodeBinary to 'node' instead of the full path to the node binary (which is what process.argv[0] equals here). But this could behave differently depending on the environment PATH.
  • use spawnSync instead of execSync (which I've done here)

I'll make a reproduction repo and file a bug in tap (tap, not spawn-wrap, since I don't understand how it all works together) but I think this workaround is acceptable for us.

Feel free to merge or just take what I've learned 🥂

@maxbeatty maxbeatty merged commit 992d241 into motdotla:node10 May 7, 2018
@maxbeatty
Copy link
Contributor

Thank you! This is great!

maxbeatty added a commit that referenced this pull request Jun 2, 2018
* drop support for Node v4, use node-tap as test runner

* rm examples

* explicitly end async test for cli

* try sync child for windows tests

* extract cli option parsing so it is included in coverage

* add cli option test relating to #306

* Fix tests on Windows by avoiding bug in spawn-wrap by using spawnSync instead of execSync (#307)
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