-
Notifications
You must be signed in to change notification settings - Fork 11
/
Gruntfile.js
80 lines (76 loc) · 1.92 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
"use strict";
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
clean: ["target"],
eslint: {
lib: {
src: ["lib/**/*.js"]
},
options: {
configFile: "conf/eslint.json"
},
gruntfile: {
src: "Gruntfile.js"
}
},
jsdoc: {
dist: {
src: "lib/*.js",
options: {
destination: "target/html"
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
quiet: false, // Optionally suppress output to standard out (defaults to false)
clearRequireCache: false // Optionally clear the require cache before running tests (defaults to false)
},
src: ['tests/**/*.js']
}
},
nyc: {
cover: {
options: {
include: ['lib/**/*.js'],
reporter: ['html', 'lcov'],
reportDir: 'coverage'
},
cmd: false,
args: ['grunt', 'mochaTest']
}
},
'gh-pages': {
options: {
base: 'target/html'
},
src: ['**/*']
},
watch: {
gruntfile: {
files: "<%= eslint.gruntfile.lib %>",
tasks: ["eslint:gruntfile"]
},
lib: {
files: "<%= eslint.lib.src %>",
tasks: ["eslint:lib"]
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-jsdoc");
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-simple-nyc');
// Task definitions.
// run `grunt <task>` in command line and it will run the sequence in brackets
grunt.registerTask("default", ["clean","jsdoc", "nyc:cover"]);
grunt.registerTask("doc", ["jsdoc", "gh-pages"]);
grunt.registerTask("test", ["mochaTest"]);
grunt.registerTask("coverage", ["nyc:cover"]);
};