istanbuljs-archived-repos / istanbul-reports

deprecated, instead use https://github.com/istanbuljs/istanbuljs
Other
14 stars 11 forks source link

Preserve escape char of json key path on Windows #12

Closed kwonoj closed 8 years ago

kwonoj commented 8 years ago

This PR updates behavior of jsonReporter for writing its key.

While coverage JSON takes path to file its key of coverage data, json reporter directly write key into file. This causes problem on windows machines since its path contains escape chars for backslash, makes stored JSON is not valid and can't be parsed directly. In this pr, stringify key as well to preserve escape chars on windows. This does not affect on non-windows system.

before screen shot 2016-10-14 at 11 53 09

after screen shot 2016-10-14 at 11 56 00

yahoocla commented 8 years ago

CLA is valid!