Created
August 8, 2014 21:59
-
-
Save lbeschastny/04ce1a889c8b698e7e5c to your computer and use it in GitHub Desktop.
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
grunt.initConfig({ | |
nodemocha: { | |
options: { | |
bin: './node_modules/.bin/', // to use locally-installed mocha | |
args: [ | |
'test/lib/*.coffee', | |
'test/mailer/*.coffee' | |
] | |
} | |
} | |
}); |
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
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