dtinth / babel-plugin-__coverage__

[deprecated; use babel-plugin-istanbul instead] Istanbul-compatible code coverage instrumentation plugin for Babel.
247 stars 17 forks source link

Fails with nyc --all #38

Open hoschi opened 8 years ago

hoschi commented 8 years ago

When using this coverage instrumenter instead of nyc's one, I get an exception when I add the --all flag. It work without the flag, so I think it is a problem with the instrumenter, not the reportet.

nyc --source-map=false --require babel-core/register --all --instrument=false --reporter=html --report-dir reports/coverage/ npm run test-simple

/home/hoschi/repos/myproject/node_modules/nyc/node_modules/istanbul/lib/object-utils.js:247
            for (i = 0; i < retArray.length; i += 1) {
                                    ^

TypeError: Cannot read property 'length' of undefined
    at /home/hoschi/repos/myproject/node_modules/nyc/node_modules/istanbul/lib/object-utils.js:247:37
    at Array.forEach (native)
    at Object.mergeFileCoverage (/home/hoschi/repos/myproject/node_modules/nyc/node_modules/istanbul/lib/object-utils.js:244:31)
    at /home/hoschi/repos/myproject/node_modules/nyc/node_modules/istanbul/lib/collector.js:71:44
    at Array.forEach (native)
    at Object.Collector.add (/home/hoschi/repos/myproject/node_modules/nyc/node_modules/istanbul/lib/collector.js:68:31)
    at /home/hoschi/repos/myproject/node_modules/nyc/index.js:303:15
    at Array.forEach (native)
    at NYC.report (/home/hoschi/repos/myproject/node_modules/nyc/index.js:302:23)
    at report (/home/hoschi/repos/myproject/node_modules/nyc/bin/nyc.js:205:7)

versions: coverage: 11.0.0 nyc: 6.6.1 node: 6.2.1

CapitanRedBeard commented 8 years ago

Also receiving this same error when running jest tests for my RN app. Versions: "jest-cli": "^12.0.2" |__ "istanbul": "^0.4.2"