Last active
December 14, 2015 03:39
-
-
Save BryanDonovan/5022389 to your computer and use it in GitHub Desktop.
Example jakefile to run mocha tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Mocha = require('mocha'); | |
var mocha = new Mocha({reporter: 'spec', ui: 'bdd'}); | |
function run_tests(cb) { | |
mocha.addFile('./test/foo.unit.js'); | |
mocha.run(function(failures) { | |
cb(failures); | |
}); | |
} | |
desc('mocha unit test-run example'); | |
task('test-run', {async: true}, function(args) { | |
run_tests(function(err) { | |
if (err) { | |
fail(err); | |
} else { | |
complete(); | |
} | |
}); | |
}); |
I could run mocha
without jake
in an application, but I couldn't succeed it in another app. Got ReferenceError: geddy is not defined
. I think geddy
should make mocha
run without jake
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run this in jake 0.7.13, the process doesn't automatically terminated. I have to use Ctrl+C to kill it after all tests are run. Is this the expected behavior?