ibrik
ibrik copied to clipboard
How can ibrik be used with mocha?
We have a suite of Mocha tests and I'm looking for a coverage tool to determine how thorough our tests are. Any idea how Mocha can integrate with ibrik? Thanks.
:+1: same question here
Same problem here, trying to add coffeescript coverage to RTD using Mocha
Would like to know about this as well...
+1, would be really excellent. I tried running ibrik cover _mocha
and it did run the tests, but exited at the end without collecting any coverage information.
Would love to get a quick response here @Constellation
:+1: I'm also looking for an answer to this.
+1 ... tried (modifying instructions for use of mocha w/ istanbul):
ibrik cover /usr/local/bin/_mocha -- --bail -u bdd --compilers coffee:coffee-script,litcoffee:coffee-script/register
... and I get:
No coverage information was collected, exit without writing coverage information.
Any update on this?
+1
The test run but no coverage collected.
ibrik cover ./node_modules/mocha/bin/_mocha -- --compilers coffee:coffee-script/register --reporter spec --recursive test/
+1
+1
This would be extremely useful.
+1
A little off topic, but I wrote this gulp plugin using the coffee instrumentor from this project to allow for coffee code coverage under mocha:
Doesn't solve this issue but at least gives a workaround.
Unfortunately, gulp-coffee-istanbul only works with code which is written for the CoffeeScriptRedux compiler, and not actual CoffeeScript. Sadly, CoffeeScriptRedux is largely abandoned and is lagging far behind CoffeeScript in feature support.
I'll investigate it at weekend.
@rimunroe I just fixed this. gulp-coffee-istanbul now uses the coffee-script compiler, not redux.
I'm using @duereg's fork of istanbul instead of gulp-coffee-istanbul:
./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --compilers coffee:coffee-script/register test/*.coffee
@justin-lau @duereg is there an open PR to have those changes to istanbul merged upstream?
@thom-nic @justin-lau There is an open pull request on istanbul that I used as the basis for my fork. But it's been hanging around since March with no ETA on a merge.
@justin-lau @duereg sorry for reviving this - i am trying to figure out how to get this istanbul fork to work since this still hasn't been merge upstream. When I try the command you listed @justin-lau I still get "No coverage information output was collected, exit without coverage information"
Can either of you perhaps help me out with this ? :) thanks.
@gilligan You figured this out, correct?
@duereg yep thanks ;-)
Just wanted to drop a note mentioning that coffee-coverage has support for Istanbul instrumentation now, and it was designed from the ground up with mocha in mind.
Got the answer of ibrik:
$ ibrik cover _mocha -- test/*.coffee
Demo: https://travis-ci.org/59naga/jasminetea/builds/65687751
Note:
test/**" isn't calculated. Can use --default-excludes
option if want include files at test/**