forked from ratracegrad/node-express-mongoose-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
93 lines (86 loc) · 3.35 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
module.exports = function(grunt) {
// file to watch and scan
var files = [
'boilerplate.js',
'app.js',
'Gruntfile.js',
'models/*.js',
'routes/*.js',
'test/*.js',
'lib/*.js'
];
grunt.initConfig({
jscs: {
scan: {
src: files,
options: {
config: 'config.jscs.json'
}
},
fix: {
src: files,
options: {
config: 'config.jscs.json',
fix: true
}
}
},
jshint: {
all: files
},
//https://github.com/pghalliday/grunt-mocha-test
mochaTest: {
tests: {
src:['test/**/*'],
options: {
reporter: 'spec'
}
},
watch: {
src:['test/**/*'],
options: {
reporter: 'nyan'
}
},
tap: {
src:['test/**/*'],
options: {
reporter: 'tap'
}
}
},
apidoc: {
boilerplate: {
src: 'routes',
dest: 'public/api-docs/'
}
},
jsdoc: {
dist: {
src: ['lib/*.js', 'routes/*.js', 'README.md'],
options: {
destination: 'public/docs',
template: 'node_modules/minami'
}
}
},
watch: {
js: {
options: {
spawn: true,
interrupt: true,
debounceDelay: 250
},
files: files,
tasks: ['mochaTest:watch']
}
}
});
// load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns
require('load-grunt-tasks')(grunt);
// register tasks
grunt.registerTask('default', ['cleanup', 'test', 'docs']);
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('cleanup', ['jscs:fix', 'jshint']);
grunt.registerTask('docs', ['apidoc', 'jsdoc']);
};