tntim96/JSCover

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

Closed this issue · 2 comments

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

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": {}
  }

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