Skip to content

Instantly share code, notes, and snippets.

@sabind
Last active May 5, 2016 18:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sabind/ee54fe0d545bf1fe6a77 to your computer and use it in GitHub Desktop.
Save sabind/ee54fe0d545bf1fe6a77 to your computer and use it in GitHub Desktop.
Adding 'grunt test' to SailsJS 0.10.x using grunt and mocha

This is an addition to a full guide on SailsJS + Mocha, but updated for SailsJS 0.10.x

The guide does not belong to me, only this change to support SailsJS 0.10.x using code originally found in the guide written by it's author.

// Place this file in tasks/config/test.js
module.exports = function(grunt) {
grunt.config.set('mochaTest', {
test: {
options: {
reporter: 'spec'
},
src: ['tests/**/*.spec.js']
}
});
grunt.loadNpmTasks('grunt-mocha-test');
};
// Place this file in tasks/register/test.js
module.exports = function (grunt) {
grunt.registerTask('test', ['mochaTest']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment