alex-seville / grunt-blanket

grunt task to instrument files for code coverage using Blanket.js
http://blanketjs.org
MIT License
29 stars 6 forks source link

ReferenceError: _$jscoverage is not defined #17

Closed sagiegurari closed 7 years ago

sagiegurari commented 8 years ago

Take a look at https://github.com/sagiegurari/simple-oracledb/blob/master/package.json When I use grunt-blanket 0.0.10 (instead of 0.0.9 like i have now), the npm test fails. npm --version 3.3.10 node --version v0.10.29 (although it fails also in node 0.12, 4, 5 and io.js)

I see the following: Running "mochaTest:coverageHTML" (mochaTest) task Verifying property mochaTest.coverageHTML exists in config...OK Files: ./target/coverage/test/spec/connection-spec.js, ./target/coverage/test/spec/index-spec.js, ./target/coverage/test/spec/pool-spec.js, ./target/coverage/test/spec/record-reader-spec.js, ./target/coverage/test/spec/record-writer-spec.js, ./target/coverage/test/spec/resultset-reader-spec.js, ./target/coverage/test/spec/rows-reader-spec.js, ./target/coverage/test/spec/simple-oracledb-spec.js, ./target/coverage/test/spec/stream-spec.js Options: reporter="html-cov", quiet, captureFile="target/coverage/report/coverage.html" Warning: Task "mochaTest:coverageHTML" failed. Use --force to continue.

From a drill down of the issue, I see the following error:

Running "mochaTest:coverageHTML" (mochaTest) task

Mocha exploded! ReferenceError: _$jscoverage is not defined at Object. (C:[path]\target\coverage\lib\constants.js:2:55) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (C:[path]\target\coverage\test\spec\connection-spec.js:7:17) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)

avdg commented 8 years ago

Got the same error. v0.0.9 works fine, v0.0.10 not.

Since https://github.com/alex-seville/grunt-blanket/commit/012699a35c97e1ef1575041d20f445b9833d63aa is the only commit involving code, its very likely caused by it.

sagiegurari commented 8 years ago

yap. saw that commit as well. didn't investigate too much, if its the change from grunt to async or the blanket dependency change. anyhow, that commit broke the task.

csreddy commented 8 years ago

I'm facing the same error too. Any resolution ?

avdg commented 8 years ago

Just stick to 0.0.9 unless someone really feels like to digg in the mess that one commit caused between 0.0.9 and 0.0.10

yamadapc commented 8 years ago

This is some issue with blanket 1.1.6 or greater... :stuck_out_tongue_closed_eyes:

I can't get mocha --require blanket to work anywhere, which is a bit frustrating. 1.2 is also broken. I'm hoping this an usage problem since 1.1.5 is around 200 commits behind master and was published in 2013.

sagiegurari commented 8 years ago

I migrated to istanbul due to this bug and the fact that the owner seems to be too busy to work on this project (see alex-seville/blanket#545)

alex-seville commented 8 years ago

Version 1.2.2 was pushed, which may resolve this issue.

That said, @sagiegurari is correct in recommending Istanbul as a reliable, maintained alternative.