forked from rain1017/async-lock
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathgruntfile.js
58 lines (52 loc) · 1019 Bytes
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict';
module.exports = function(grunt) {
// Unified Watch Object
var watchFiles = {
libJS: ['gruntfile.js', 'index.js', 'lib/**/*.js'],
testJS: ['test/**/*.js']
};
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
env: {
test: {
NODE_ENV: 'test'
}
},
watch: {
libJS: {
files: watchFiles.libJS.concat(watchFiles.testJS),
tasks: ['jshint'],
options: {
livereload: true
}
}
},
jshint: {
all: {
src: watchFiles.libJS.concat(watchFiles.testJS),
options: {
jshintrc: true
}
}
},
mochaTest: {
test : {
src: watchFiles.testJS,
options : {
reporter: 'spec',
timeout: 5000,
noFail: false
}
}
}
});
// Load NPM tasks
require('load-grunt-tasks')(grunt);
// Lint task(s).
grunt.registerTask('lint', ['jshint']);
// Test task.
grunt.registerTask('test', ['lint', 'env:test', 'mochaTest']);
// Default task(s).
grunt.registerTask('default', ['test']);
};