Created
February 20, 2014 04:36
-
-
Save zpratt/9107164 to your computer and use it in GitHub Desktop.
Basic configuration for running bdd and tdd tests with mocha integration.
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'; | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
jshint: { | |
options: { | |
jshintrc: '.jshintrc' | |
}, | |
gruntfile: { | |
src: 'Gruntfile.js' | |
}, | |
test: { | |
src: ['test/**/*.js'] | |
} | |
}, | |
mochacov: { | |
options: { | |
reporter: 'spec', | |
ui: 'bdd' | |
}, | |
unit: ['test/unit/server/**/*.spec.js'], | |
bdd_server: ['test/acceptance/server/*.spec.js'] | |
} | |
}); | |
// These plugins provide necessary tasks. | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-mocha-cov'); | |
// Default task. | |
grunt.registerTask('default', ['jshint', 'test']); | |
grunt.registerTask('test', ['unit:server', 'bdd']); | |
grunt.registerTask('unit:server', ['jshint', 'mochacov:unit']); | |
grunt.registerTask('bdd', ['mochacov:bdd_server']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment