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

[changed] catch babel transformation exceptions and pipe them to stderr #40

Closed thealjey closed 8 years ago

thealjey commented 8 years ago

When Babel transformation fails for some reason and an exception is thrown - an empty coverage directory is created and no report is printed to the terminal (because Babel is called in the process exit handler). As a result Istanbul simply refuses to work without any indication of error. Kind of like is described here.

jeffrifwald commented 8 years ago

This should probably go in the transformer instead of here. There is too much that can go wrong in that call.

https://github.com/ambitioninc/babel-istanbul/blob/master/lib/instrumenter.js#L455

jeffrifwald commented 8 years ago

I'm not sure that this is the correct recourse either. I'll have to ponder this a little bit. This might just be an artifact of how you run your tests (creating multiple subprocesses).

jeffrifwald commented 8 years ago

I specifically remember babel failing before istanbul even gets ahold of things if you use babel-node to run your tests. That should probably be the optimal course of action.