gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

HTML Reporter Fails with `meta` being undefined #708

Closed bassettsj closed 8 years ago

bassettsj commented 8 years ago

When using babel-plugin-istanbul some of the files are not returning the expected meta for the html reporter to be able to annotate the files correctly. I get the following error for the stack trace.

12 10 2016 11:20:00.789:ERROR [coverage]: TypeError: Cannot read property 'start' of undefined
    at /project/node_modules/istanbul/lib/report/html.js:276:32
    at Array.forEach (native)
    at annotateBranches (/project/node_modules/istanbul/lib/report/html.js:255:30)
    at HtmlReport.writeDetailPage (/project/node_modules/istanbul/lib/report/html.js:426:9)
    at /project/node_modules/istanbul/lib/report/html.js:489:26
    at SyncFileWriter.writeFile (/project/node_modules/istanbul/lib/util/file-writer.js:57:9)
    at FileWriter.writeFile (/project/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at /project/node_modules/istanbul/lib/report/html.js:488:24
    at Array.forEach (native)
    at HtmlReport.writeFiles (/project/node_modules/istanbul/lib/report/html.js:482:23)
    at /project/node_modules/istanbul/lib/report/html.js:484:22
    at Array.forEach (native)
    at HtmlReport.writeFiles (/project/node_modules/istanbul/lib/report/html.js:482:23)
    at HtmlReport.writeReport (/project/node_modules/istanbul/lib/report/html.js:566:14)
    at LcovReport.writeReport (/project/node_modules/istanbul/lib/report/lcov.js:55:19)
    at writeReport (/project/node_modules/karma-coverage/lib/reporter.js:68:16)
bassettsj commented 8 years ago

Closing I think this is related to https://github.com/speedskater/babel-plugin-rewire/issues/165