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(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could run
mocha
withoutjake
in an application, but I couldn't succeed it in another app. GotReferenceError: geddy is not defined
. I thinkgeddy
should makemocha
run withoutjake
.