Closed gajus closed 8 years ago
Hi!
I know that this is probably not the best place to ask a question like that.
But since there's no Babel 6 support yet (and I want it real bad) and since babel-istanbul
is supposed to be a drop in replacement, I figured I could just use istanbul
on the code compiled with Babel 6 (I thought it'd be basically the same thing).
So, I went from this (worked perfectly with Babel 5):
babel-istanbul cover --root lib --print detail --include-all-sources jasmine
to this:
istanbul cover --root build --print detail --include-all-sources jasmine
However, even though all of my 179 specs are still passing (jasmine has no problem finding them), istanbul
prints "No coverage information was collected, exit without writing coverage information" and does nothing.
Sorry for bothering.
There are some pretty nasty bugs in Babel 6, so I'm waiting on some semblance of stability in the plugin/preset system before I start digging in with this package. I'd assume sometime next week things will calm down over there.
@thealjey I'm not sure how your jasmine specs are set up, but I am assuming either jasmine or istanbul is just looking in the wrong spot for your build files.
Well, that's the thing, Babel 6 works just fine now (at least the parts that I'm using), I've checked.
Also, all of my tests are still passing.
As to the setup, there isn't much more of it than I already wrote about.
I have 3 directories - lib
(source files), build
(Babel compiled files), spec
(*Spec.js specs).
babel lib --out-dir build --presets es2015,stage-2,react --plugins transform-react-display-name,transform-runtime
istanbul cover --root build --print detail --include-all-sources jasmine
that is it, nothing more to it
istanbul
finds the files under --root, passes them on to jasmine
, which successfully executes all of the tests
but then, all of a sudden, it says that no coverage information was collected :open_mouth:
I figured it out, turns out you need to specify --root for both istanbul
and jasmine
(one more "build" at the end):
istanbul cover --root build --print detail --include-all-sources jasmine build
However, I have a new problem now, istanbul
now wants me to cover "_interopRequireDefault", "__esModule" and the rest of the Babel noise.
It also reports that code inside class constructor functions, methods defined as {key: ..., value: ...} and other completely random things (which are definitely covered, I've always had 100% coverage on the project) are not covered.
So, it seems that you are my only hope, I'm very impatient, but I'll wait :blush:
I didn't realize how important babel-istanbul
was to me until I couldn't use it any more.
I can't believe I could be so dumb/blind, the only thing that does not currently work with babel-istanbul
is "--include-babel-polyfill" and that doesn't seem all that important, cause everything works just fine without it.
So, I'm back at 100% percent coverage, using babel-istanbul
again, and couldn't be happier :smile:
I won't be spamming you guys any more, promise :blush:
0.5.5
should be up to date with babel 6 support. Big change is there are no longer command line flags for babel options. We'll have to use .babelrc files from here on out since the plugin system it has gotten too complicated to address with command line arguments now.
https://babeljs.io/blog/2015/10/29/6.0.0/