Fix no coverage with globally installed testers on Windows #104
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.
This is a try on fixing the bug where nyc does not report coverage data when the test runners are installed globally on Windows. This fixes #1029 on nyc repo.
As I explained on the nyc issue, on Windows the modules "executables" are
*.cmd
files that check if the node executable is under the same directory and if so they use it instead of the one in PATH.My solution is to copy those scripts (batch/shell/powershell) to the same temporary directory you guys already use for the node script and modify them to point to their correct module paths. Honestly I fear this solution is too dirty and not fail proof, but has worked fine with both AVA and mocha.
I have tested with
cmd
andMSYS2/Mintty
. I have not tested with local installations of the testers.CC: @bcoe