Skip to content

Instantly share code, notes, and snippets.

@lbeschastny
Created August 8, 2014 21:59
Show Gist options
  • Save lbeschastny/04ce1a889c8b698e7e5c to your computer and use it in GitHub Desktop.
Save lbeschastny/04ce1a889c8b698e7e5c to your computer and use it in GitHub Desktop.
grunt.initConfig({
nodemocha: {
options: {
bin: './node_modules/.bin/', // to use locally-installed mocha
args: [
'test/lib/*.coffee',
'test/mailer/*.coffee'
]
}
}
});
module.exports = function(grunt) {
'use strict';
var path = require('path'),
exec = require('child_process').exec;
grunt.registerTask('nodemocha', 'Run node tests with mocha', function() {
var bin, cmd, proc,
options = this.options(),
done = this.async();
bin = path.join((options.bin || ''), 'mocha');
cmd = [bin].concat(options.args || []).join(' ');
proc = exec(cmd, function(err) {
done(err);
});
proc.stdout.pipe(process.stdout);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment