douglasduteil / isparta

:skull: A code coverage tool for ES6 (babel/6to5)
Do What The F*ck You Want To Public License
643 stars 47 forks source link

Problems with Mocha #93

Open denysdovhan opened 8 years ago

denysdovhan commented 8 years ago

Issue for that: https://github.com/douglasduteil/isparta/issues/81#issuecomment-158242061

I have the same problem. I temporarily fixed it like this:

"scripts": {
   "coverage": "babel-node ./node_modules/.bin/isparta cover _mocha index.js -- --require babel-core/register"
}

But I dont think it's looks so elegant.

iamstarkov commented 8 years ago

this is working

"coverage": "babel-node ./node_modules/.bin/isparta cover _mocha index.js -- --compilers js:babel-core/register",
jescalan commented 8 years ago

I'm having some issues with mocha and es2015 as well. It only generates coverage if I include --include-all-sources as an option, but doesn't actually give full coverage, it only covers the index.js file and none of the other library files in the project.

Has anyone else seen behavior like this? Working with a bare bones project set up to only have a couple example files and a test framework, so I don't think I've got any extra complications here. If it would help I could link to the project here...

jamesplease commented 8 years ago

This project may help people. It's working examples of using Babel v6 with popular testing tools like Mocha.

@jenius, link me to that project and I'll take a look.

jescalan commented 8 years ago

Awesome, thanks @jmeas! This is the project I'm working with: https://github.com/jenius/stockfighter-node