-
Notifications
You must be signed in to change notification settings - Fork 32
Fatal error causes Mocha to exit #16
Comments
Hmm, I can't replicate this, and I'm inclined to think it's a bug with the Mocha API interface. But I'll take a closer look when I get a chance. I'd love to build on the Mocha API interface when I get some time.. |
Yea.. I didn't run into this error until I started adding in Webdriver tests via GhostDriver on phantomJS, so maybe there needs to be something additional added, I'll also be looking and see if I can get a solution. As it would be great to not have to use a hacked together solution with alerts and AJAX bridges etc to get front-end testing now that we have a proper selenium driver for PhantomJS. Thanks for any effort you put in 👍 Hopefully the magic 🎱 will help me in my quest :) |
Thanks for the issue! Are you already aware of the wildly popular grunt-mocha? It's designed for tests using PhantomJS, and there seems to be a lot of code dedicated to printing the results correctly. I mainly didn't like its dependency on PhantomJS, but you're already using PhantomJS so maybe that won't be an issue for you.. :) |
The only reason I haven't hopped over to grunt-mocha is that the project was to support testing on PhantomJS before it was supported. Now, PhantomJS provides a native WebDriver called GhostDriver. So the way that grunt-mocha communicates is neat, but unneeded now. I haven't looked deeply at the source for it but I know older similar types of libraries used iframe + alerts to provide communication, I'd rather be able to use the JSONWireProtocol. I may just use grunt exec or shell and run mocha directly to get the results.. Hm. |
This is a pretty gnarly issue and has been bugging me for a while... Mocha needs |
#29 if you think this is worth it |
So it looks like 3 out of 3 serverside grunt + mocha modules on npm have this issue. Maybe you guy's should team up? :) |
👍 this appears to be an issue with how Here's my own custom grunt task that also demonstrates this: Mocha = require('mocha')
module.exports = (grunt) ->
_ = grunt.util._
grunt.registerMultiTask "spec", "run specs (under mocha)", ->
done = @async()
mocha = new Mocha(@options())
@filesSrc.forEach(mocha.addFile.bind(mocha))
grunt.file.expand("#{process.cwd()}/spec/helpers/**/*").forEach (f) -> require(f)
mocha.run (errorCount) -> done(errorCount == 0) |
See mochajs/mocha#735
The text was updated successfully, but these errors were encountered: