tntim96 / JSCover

JSCover is a JavaScript Code Coverage Tool that measures line, branch and function coverage
GNU General Public License v2.0
399 stars 84 forks source link

Reports merge error: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double #266

Closed mdsina closed 6 years ago

mdsina commented 6 years ago

Hello, I've found some issue on merging reports:

JSCover version: 2.0.2

Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double
    at jscover.report.JSONDataMerger.getIntOrNull(JSONDataMerger.java:455)
    at jscover.report.JSONDataMerger.jsonToMap(JSONDataMerger.java:411)
    at jscover.report.Main.mergeJSON(Main.java:443)
    at jscover.report.Main.mergeReports(Main.java:421)
    at jscover.report.Main.runReport(Main.java:411)
    at jscover.report.Main.runMain(Main.java:394)
    at jscover.report.Main.main(Main.java:366)

The attached file failed to merge

coverage_issue.txt

tntim96 commented 6 years ago

I noticed a NaN in the JSON. Any idea how that got there? Is it possible to upload the source for that file?

  "/utils/types.js": {
    "lineData": [
      null,
      2,
      null,
      null,
      NaN,
      null,
      1
    ],
    "functionData": [
      2
    ],
    "branchData": {}
  }
tntim96 commented 6 years ago

Please re-open if you have more details so that I can reproduce the issue.