forked from joanvila/raml-js-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
76 lines (64 loc) · 2.07 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
module.exports = function(grunt) {
// Add the grunt-mocha-test tasks.
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-coveralls');
grunt.initConfig({
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js']
}
},
watch: {
js: {
files: ['bin/**/*.js', 'lib/**/*.js'],
tasks: ['jshint'],
}
},
jshint: {
options: {
'esversion': 6,
'node': true,
'mocha': true
},
all: [
'Gruntfile.js',
'bin/**/*.js',
'lib/**/*.js',
'!node_modules/**/'
]
},
shell: {
options: {
stderr: false
},
coverage: './node_modules/.bin/istanbul cover node_modules/.bin/_mocha test/ -R spec'
},
coveralls: {
options: {
// When true, grunt-coveralls will only print a warning rather than
// an error, to prevent CI builds from failing unnecessarily (e.g. if
// coveralls.io is down). Optional, defaults to false.
force: false
},
upload: {
// LCOV coverage file (can be string, glob or array)
src: 'coverage/lcov.info',
options: {
// Any options for just this target
}
}
}
});
grunt.registerTask('mocha', 'mochaTest');
grunt.registerTask('watch', 'watch');
grunt.registerTask('lint', 'jshint');
grunt.registerTask('coverage', 'shell:coverage');
grunt.registerTask('uploadcoveralls', 'coveralls:upload');
grunt.registerTask('test', ['jshint', 'mochaTest', 'shell:coverage']);
grunt.registerTask('default', ['jshint', 'mochaTest']);
};