-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
50 lines (41 loc) · 1.22 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
'use strict';
var CONNECT_PORT = 9090;
var CONNECT_PORT_TEST = 9091;
var LIVERELOAD_PORT = 35742;
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
var alarm = {
app: 'app',
src: 'src',
livereloadPort: LIVERELOAD_PORT,
connectPort: CONNECT_PORT,
connectPortTest: CONNECT_PORT_TEST
};
var options = ['jshint', 'jscs', 'mochaTest', 'coveralls' , 'mocha_istanbul'];
grunt.config.init(options.reduce(function (accumulator, val) {
accumulator[val] = (require('./grunt/' + val + '.js'))(accumulator.alarm, grunt);
return accumulator;
}, {
alarm: alarm
}));
grunt.event.on('coverage', function (lcov, done) {
require('coveralls').handleInput(lcov, function (err) {
if (err) {
return done(err);
}
done();
});
});
grunt.registerTask('default', 'Default build tasks', [
'jshint',
'jscs'
]);
grunt.registerTask('test', 'Default build tasks', [
'default',
'mochaTest:test'
]);
grunt.registerTask('coverage', 'Save coverage in coveralls', [
'mocha_istanbul:coveralls',
'coveralls'
]);
};