-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntFile.js
110 lines (106 loc) · 2.29 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*global module*/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-cov');
// Project configuration.
grunt.initConfig({
watch: {
files: ['index.js', 'lib/**/*.js', 'test/**/*.js', 'config/**/*.js'],
tasks: ['default', 'timestamp']
},
jshint: {
files: ['gruntFile.js', 'index.js', 'lib/**/*.js', 'test/**/*.js', 'config/**/*.js'],
options: {
node: true,
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
globals: {
describe: false,
it: false,
before: false,
after: false
}
}
},
jsbeautifier: {
'default': {
src: '<%= jshint.files %>',
options: {
html: {
indentSize: 2,
maxPreserveNewlines: 1
},
css: {
indentSize: 2
},
js: {
indentSize: 2
}
}
},
release: {
src: '<%= jsbeautifier.default.src %>',
options: {
mode: 'VERIFY_ONLY',
html: {
indentSize: 2,
maxPreserveNewlines: 1
},
css: {
indentSize: 2
},
js: {
indentSize: 2
}
}
}
},
mochacov: {
test: {
options: {
reporter: 'spec'
}
},
travis: {
options: {
coveralls: {
serviceName: 'travis-ci'
}
}
},
cov: {
options: {
reporter: 'html-cov',
output: 'coverage.html'
}
},
options: {
files: ['test/**/*.js']
}
}
});
// Default task.
grunt.registerTask('default', ['jshint',
'jsbeautifier:default',
'mochacov:test'
]);
grunt.registerTask('cov', ['mochacov:cov']);
grunt.registerTask('release', ['jshint',
'jsbeautifier:release',
'mochacov:test',
'mochacov:travis'
]);
grunt.registerTask('timestamp', function() {
grunt.log.subhead(Date());
});
};