jeffrifwald / babel-istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
144 stars 23 forks source link

No coverage information was collected, exit without writing coverage information && ERROR: No coverage files found. #36

Closed kennetpostigo closed 8 years ago

kennetpostigo commented 8 years ago

Hello, Im currently trying to implement babel-istanbul with travis, codecov, and ghooks. But I keep getting the errors that no coverage information is being collected. I'm not sure why. I've been attempting to get this to work and have looked through tons of articles and gists, but none help me out.

This is package.json file:

screen shot 2015-11-15 at 8 18 54 pm

This is what happens when I run the test:single(at the end it says "No coverage information was collected, exit without writing coverage information"):

screen shot 2015-11-15 at 8 19 57 pm

This is what happens when I run check-coverage to check the quality with babel-istanbul:

screen shot 2015-11-15 at 8 20 11 pm

I really hope someone can help me out, any and all help & feedback is very much appreciated.

noamshemesh commented 8 years ago

:+1: I'm encountering the same issue

jeffrifwald commented 8 years ago

To my knowledge: istanbul has never worked with mocha when using compilers. Try running your tests with babel-node.

lfilho commented 8 years ago

@jmcriffey how so? I've tried: babel-node node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- test --recursive --compilers js:babel-core/register But it didn't work: same error No coverage information was collected, exit without writing coverage information appears. :(

jeffrifwald commented 8 years ago

@lfilho You CANNOT use --compilers js:babel-core/register. That is causing another process to be spawned and istanbul cannot read coverage from it. Remove that part and see if it starts working.

babel-node node_modules/babel-istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- test --recursive
kennetpostigo commented 8 years ago

Hey guys I was able to get it up and running :)

lfilho commented 8 years ago

@jmcriffey that's right! Now it works! Thanks!

lfilho commented 8 years ago

I miss the --print both option though :( :innocent: