I’m working on a project where I write a webservice on Node.js and I find that grunt-contrib-jasmine is a bit slow to start. I couldn’t find amy module on npm that would do that, so I wrote my own task:
grunt.registerTask('jasmine', [], function() {
var exec = require('child_process').exec,
done = this.async();
var child = exec('jasmine-node --matchall test', function(error, stdout, stderr) {
if (error) grunt.warn(error);
done();
});
child.stdout.on('data', function (data) {
process.stdout.write(data);
});
child.stderr.on('data', function (data) {
process.stdout.write(data);
});
});