UNPKG

1.18 kBJavaScriptView Raw
1'use strict';
2
3module.exports = function (grunt) {
4
5 // Project configuration.
6 grunt.initConfig({
7 mochaTest: {
8 test: {
9 options: {
10 reporter: 'spec'
11 },
12 src: ['test/**/*.js']
13 }
14 },
15 jshint: {
16 options: {
17 jshintrc: '.jshintrc'
18 },
19 gruntfile: {
20 src: 'Gruntfile.js'
21 },
22 lib: {
23 src: ['lib/**/*.js']
24 }
25 },
26 watch: {
27 gruntfile: {
28 files: '<%= jshint.gruntfile.src %>',
29 tasks: ['jshint:gruntfile']
30 },
31 lib: {
32 files: '<%= jshint.lib.src %>',
33 tasks: ['jshint:lib', 'mochaTest']
34 },
35 test: {
36 files: '<%= jshint.test.src %>',
37 tasks: ['jshint:test', 'mochaTest']
38 }
39 }
40 });
41
42 // These plugins provide necessary tasks.
43 grunt.loadTasks('./tasks');
44 grunt.loadNpmTasks('grunt-mocha-test');
45 grunt.loadNpmTasks('grunt-contrib-jshint');
46 grunt.loadNpmTasks('grunt-contrib-watch');
47
48 // Default task.
49 grunt.registerTask('default', ['jshint', 'mochaTest']);
50
51 // Default task.
52 grunt.registerTask('test', ['jshint', 'mochaTest']);
53};