UNPKG

945 BJavaScriptView Raw
1'use strict';
2
3module.exports = function(grunt) {
4
5 grunt.loadNpmTasks('grunt-mocha-test');
6 grunt.loadNpmTasks('grunt-release');
7
8 grunt.initConfig({
9 mochaTest: {
10 test: {
11 options: {
12 reporter: 'spec',
13 require: 'coffee-script'
14 },
15 src: ['test/**/*.coffee']
16 }
17 },
18 release: {
19 options: {
20 tagName: 'v<%= version %>',
21 commitMessage: 'Prepared to release <%= version %>.'
22 }
23 },
24 watch: {
25 files: ['Gruntfile.js', 'test/**/*.coffee'],
26 tasks: ['test']
27 }
28 });
29
30 grunt.event.on('watch', function(action, filepath, target) {
31 grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
32 });
33
34 // load all grunt tasks
35 require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
36
37 grunt.registerTask('test', ['mochaTest']);
38 grunt.registerTask('test:watch', ['watch']);
39 grunt.registerTask('default', ['test']);
40};