alex-seville / blanket

blanket.js is a simple code coverage library for javascript. Designed to be easy to install and use, for both browser and nodejs.
http://blanketjs.org
Other
1.41k stars 177 forks source link

Cannot npm shrinkwrap blanket@1.1.7 #501

Open Magomogo opened 9 years ago

Magomogo commented 9 years ago

Probably this issue related to https://github.com/substack/node-falafel/issues/30 bug.

I get the message extraneous: esprima@1.1.0-dev. Shrinkwrap works fine when I switch to blanket@1.1.6

benoneal commented 9 years ago

I'm getting the same problem. invalid: esprima@1.1.0-dev /Users/ben.oneal/Code/nfp-profile/node_modules/blanket/node_modules/falafel/node_modules/esprima

madarche commented 9 years ago

Yes this is related to substack/node-falafel#30 .

madarche commented 9 years ago

This is really a blocker.

madarche commented 9 years ago

I have updated the dependencies of blanket (I'm working from the HEAD of the repo ) so to use the latest fixed version of falafel, but it breaks the blanket tests in a way it seems that only someone with a good knowledge of how blanket works can fix:

Running:./node_modules/mocha/bin/mocha test/test-node/testrunner.js

Error:/home/sweet/blanket/src/blanket.js:233
                        throw new Error("The instrumenter encountered a node with no location: "+Object.keys(node));
                        ^

Error: The instrumenter encountered a node with no location: start,declarations,kind,type,end,parent,source,update
  at /home/sweet/blanket/src/blanket.js:233:31
  at walk (/home/sweet/blanket/node_modules/falafel/index.js:49:9)
  at /home/sweet/blanket/node_modules/falafel/index.js:41:25
  at forEach (/home/sweet/blanket/node_modules/falafel/node_modules/foreach/index.js:12:16)
  at /home/sweet/blanket/node_modules/falafel/index.js:39:17
  at forEach (/home/sweet/blanket/node_modules/falafel/node_modules/foreach/index.js:12:16)
  at walk (/home/sweet/blanket/node_modules/falafel/index.js:34:9)
  at module.exports (/home/sweet/blanket/node_modules/falafel/index.js:50:7)
  at Object.__dirname.blanket._blanket.instrument (/home/sweet/blanket/src/blanket.js:115:37)
  at Object.require.extensions..js (/home/sweet/blanket/src/index.js:155:25)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/home/sweet/blanket/test/test-node/tests/blanket_core.js:4:19)
  at Module._compile (module.js:434:26)
  at Module._extensions..js (module.js:452:10)
  at Object.require.extensions..js (/home/sweet/blanket/src/index.js:181:17)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/home/sweet/blanket/test/test-node/testrunner.js:16:1)
  at Module._compile (module.js:434:26)
  at Object.Module._extensions..js (module.js:452:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at /home/sweet/blanket/node_modules/mocha/lib/mocha.js:216:27
  at Array.forEach (native)
  at Mocha.loadFiles (/home/sweet/blanket/node_modules/mocha/lib/mocha.js:213:14)
  at Mocha.run (/home/sweet/blanket/node_modules/mocha/lib/mocha.js:453:10)
  at Object.<anonymous> (/home/sweet/blanket/node_modules/mocha/bin/_mocha:401:18)
  at Module._compile (module.js:434:26)
  at Object.Module._extensions..js (module.js:452:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Function.Module.runMain (module.js:475:10)
  at startup (node.js:117:18)
  at node.js:951:3
Running:./node_modules/mocha/bin/mocha --compilers coffee:coffee-script/register test/test-node/testrunner_cs.js
Warning: Task "blanketTest:normal" failed. Use --force to continue.
madarche commented 9 years ago

I've made a little progress in trying to upgrade blanket to the latest falafel module: I have created a fork with a dedicated feat-update-deps branch.

Falafel switched from using esprima as a parser to acorn. Now it is needed to pass locations:true instead of loc:true to falafel. That's what is done in my branch with commit https://github.com/madarche/blanket/commit/3a7526ce1451513bdd52d180663f7c9b7cacf93f

Now some tests pass but not all and obviously there are other changes needed to make blanket work with the new falafel.

Could some people help please? @alex-seville please? Any hints?

Cheers