This repository has been archived by the owner on Aug 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
118 lines (110 loc) · 2.83 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
111
112
113
114
115
116
117
118
'use strict';
var blanket = require('blanket');
var tasks = require('load-grunt-tasks');
var time = require('time-grunt');
module.exports = function (grunt) {
time(grunt);
tasks(grunt);
blanket({
'data-cover-only': 'lib/',
'data-cover-never': 'node_modules/'
});
grunt.initConfig({
bumpup: {
options: {
newlineEof: true
},
file: 'package.json'
},
coveralls: {
src: 'test/lcov.info'
},
jscs: {
options: {
config: '.jscsrc'
},
src: [
'**/*.js',
'!node_modules/**/*.js'
]
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
src: [
'**/*.js',
'**/*.json',
'!node_modules/**/*.js',
'!node_modules/**/*.json'
]
},
mochaTest: {
options: {
colors: true,
ui: 'bdd'
},
spec: {
options: {
reporter: 'spec'
},
src: 'test/*.test.js'
},
'html-cov': {
options: {
captureFile: 'test/coverage.html',
quiet: true,
reporter: 'html-cov'
},
src: 'test/*.test.js'
},
'console-cov': {
options: {
reporter: 'mocha-cov-reporter'
},
src: 'test/*.test.js'
},
'lcov-cov': {
options: {
captureFile: 'test/lcov.info',
quiet: true,
reporter: 'mocha-lcov-reporter'
},
src: 'test/*.test.js'
}
},
module: {
'check-repository': {
options: {
branch: 'master',
check: true
}
},
'release-publish': {
options: {
release: true,
publish: true
}
}
}
});
grunt.registerTask('test', [
'jscs',
'jshint',
'mochaTest:spec',
'mochaTest:html-cov',
'mochaTest:console-cov',
'mochaTest:lcov-cov'
]);
grunt.registerTask('publish', function (type) {
grunt.task.run('test');
grunt.task.run('module:check-repository');
grunt.task.run('bumpup:' + type);
grunt.task.run('module:release-publish');
});
grunt.registerTask('travis', [
'test',
'coveralls'
]);
grunt.registerTask('default', 'test');
};