-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Coverage report not valid JSON on Windows #1611
Comments
we should probably implement some kind of path normalization function that will lowercase the cc @Daniel15 |
Hmm... Are we hand crafting JSON here? JSON.stringify should be escaping Case sensitivity issues are also present on Mac OSX, which also uses a case Sent from my phone. On Sep 6, 2016 7:11 PM, "Dmitrii Abramov" notifications@github.com wrote:
|
hm... we shouldn't be writing any JSON manually. this is strange |
I confirmed that |
@Daniel15 i'll look inside istanbul coverage reporters. most likely it's something in there that's causing this |
@IljaKroonen we'll need more info to be able to troubleshoot this issue. Can you provide a repository that we can npm install and npm test that highlights the issue you are running into? Thanks! |
Any basic Jest setup has the problem on my system. I made a repo: This is my output:
|
I came to hit this issue as well and spent some time to dig into, and found istanbul's json reporter write its key without stringify makes escape chars are losing on windows machines. Created PR to amend those behavior at istanbuljs-archived-repos/istanbul-reports#12 . |
Wow, good catch @kwonoj! |
thanks @kwonoj. This should be within the semver range when istanbul gets published so it should be fixed in Jest automatically with a reinstall once your PR gets merged and released. Closing here. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When generating a coverage report on windows, the output coverage-final.json is not valid JSON because the path to the files contains unescaped backslashes (in the keys). Example of the start of a file:
JSON.parse output:
What is the expected behavior?
The coverage-final.json file should be a JSON file.
Run Jest again with
--debug
and provide the full configuration it prints. Please mention your node and npm version and operating system.Windows 10
Jest is in version v15.1.1
The text was updated successfully, but these errors were encountered: