-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathGruntfile.js
43 lines (42 loc) · 987 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
module.exports = function(grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
grunt.initConfig({
eslint: {
src: ["lib/**/*.js"]
},
mocha_istanbul: {
coveralls: {
src: ['test/**/*.js'],
options: {
coverage: true,
root: './lib',
reportFormats: ['lcovonly']
}
}
},
mochaTest: {
test: {
src: ['test/**/*-spec.js'],
options: {
reporter: 'spec',
logErrors: true,
timeout: 1000,
run: true
}
}
}
});
grunt.event.on('coverage',function(lcov,done){
require('coveralls').handleInput(lcov,function(err){
if (err){
return done(err);
}
done();
});
});
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.registerTask('coveralls',['mocha_istanbul:coveralls']);
grunt.registerTask('test', ['eslint', 'mochaTest']);
grunt.registerTask('default', ['test','coveralls']);
};