forked from lejlabecirspahic/blue-button-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
114 lines (107 loc) · 3.34 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
/*global module*/
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-istanbul-coverage');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-jsbeautifier');
// Project configuration.
grunt.initConfig({
alljsfiles: ['lib/**/*.js', 'test/**/*.js', 'Gruntfile.js', 'package.json', 'index.js'],
jshint: {
files: '<%= alljsfiles%>',
options: {
browser: true,
smarttabs: true,
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: false,
boss: true,
eqnull: true,
node: true,
expr: true,
globals: {
'it': true,
'xit': true,
'describe': true,
'before': true,
'after': true,
'done': true
}
}
},
watch: {
all: {
files: '<%= alljsfiles%>',
tasks: ['default']
}
},
jsbeautifier: {
beautify: {
src: '<%= alljsfiles%>',
options: {
config: '.jsbeautifyrc'
}
},
check: {
src: '<%= alljsfiles%>',
options: {
mode: 'VERIFY_ONLY',
config: '.jsbeautifyrc'
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
timeout: '10000',
recursive: true
},
src: ['test/**/*.js']
}
},
coveralls: {
options: {
// LCOV coverage file relevant to every target
src: 'coverage/lcov.info',
// 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
},
//your_target: {
// Target-specific LCOV coverage file
//src: 'coverage-results/extra-results-*.info'
//},
},
coverage: {
options: {
thresholds: {
'statements': 50,
'branches': 25,
'lines': 50,
'functions': 50
},
dir: 'coverage/',
root: '.'
}
}
});
// Default task.
grunt.registerTask('default', ['beautify', 'jshint', 'mochaTest']);
//Express omitted for travis build.
grunt.registerTask('commit', ['jshint', 'mochaTest']);
grunt.registerTask('mocha', ['mochaTest']);
grunt.registerTask('timestamp', function () {
grunt.log.subhead(Date());
});
//JS beautifier
grunt.registerTask('beautify', ['jsbeautifier:beautify']);
};