Open bryanburgers opened 7 years ago
Is this a similar issue? Due to the logger = default to a new instance of the function?
The tests exhaustedly try all combinations of the init function, and then I get 'yellow' for the rest of the method - which seems highly odd as they are indeed run through.
Either that or I'm missing what the feedback here is properly providing.
Hi, I noticed an error also happened on my codes. The error is:
SyntaxError: Unexpected token :
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions.(anonymous function) [as .js] (/home/user/.nvm/versions/node/v7.9.0/lib/node_modules/istanbul/lib/hook.js:107:24)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/user/codes/projects/myproject/index.js:9:552)
at Module._compile (module.js:571:32)
at Object.Module._extensions.(anonymous function) [as .js] (/home/user/.nvm/versions/node/v7.9.0/lib/node_modules/istanbul/lib/hook.js:107:24)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
After much commenting and uncommenting the code, I have located the error happened when using destructuring object with default, much like this issue.
Cheers.
Same for me ^^ You can find it there : https://coveralls.io/builds/13109007/source?filename=src%2FTorrentLibrary.js#L190
EDIT : If anyone wants a quick fix , use / istanbul ignore next /
same for me
I have a function defined as follows in my code:
This bit of code is causing Istanbul to fail.
Error message
$ npm run coverage > istanbul-test@0.0.0 coverage /Users/bburgers/projects/tmp > istanbul cover --include-all-sources -i 'lib/**' _mocha 'test/**/*.js' No coverage information was collected, exit without writing coverage information /Users/bburgers/projects/tmp/lib/thing.js:9 function thing({localOne=1:localOne=1}={}){__cov_xOmAt4oxzoE9o4mYWd1f7w.f['1']++;__cov_xOmAt4oxzoE9o4mYWd1f7w.s['2']++;return localOne;}__cov_xOmAt4oxzoE9o4mYWd1f7w.s['3']++;module.exports=thing; ^ SyntaxError: Unexpected token : at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at Object.Module._extensions.(anonymous function) [as .js] (/Users/bburgers/projects/tmp/node_modules/istanbul/lib/hook.js:107:24) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.This does not seem to be an issue with esprima; this bit of code is correctly parsed by
esprima@2.7.x
.It also seems to happen only with the combination of the two es6 features. Both of these bits of code seem to not bother Istanbul:
I pushed up a repo that replicates this issue: https://github.com/bryanburgers/istanbul-error-reproduction
Run tests with
npm test
. Run istanbul withnpm run coverage
.Running on node 6.8.1.