/
Gruntfile.js
68 lines (60 loc) · 1.66 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
module.exports = function (grunt) {
'use strict';
// set up common objects for jslint
var jsLintStandardOptions = {edition: 'latest', errorsOnly: true, failOnError: true};
var libDirectives = function () {
return {indent: 2, node: true, nomen: true, todo: true, unparam: true, vars: true};
};
var jsLintLibDirectives = libDirectives();
var jsLintLibTestDirectives = libDirectives();
jsLintLibTestDirectives.ass = true;
jsLintLibTestDirectives.predef = ['afterEach', 'after', 'beforeEach', 'before', 'describe', 'it'];
grunt.initConfig({
clean: {
coverage: ['coverage'],
options: {force: true}
},
jslint: {
lib: {
src: [
'lib/**/*.js'
],
directives: jsLintLibDirectives,
options: jsLintStandardOptions
},
libtests: {
src: [
'test/**/*.js'
],
directives: jsLintLibTestDirectives,
options: jsLintStandardOptions
}
},
mocha_istanbul: {
test: {
src: 'test',
options: {
coverageFolder: 'coverage',
timeout: 6000,
slow: 100,
mask: '**/*.js',
root: 'lib',
reporter: 'dot',
check: {
lines: 90,
statements: 90
}
}
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-jslint');
grunt.registerTask('tests', ['clean', 'jslint', 'mocha_istanbul']);
// Default task.
grunt.registerTask('default', ['tests']);
// Travis-CI task
grunt.registerTask('travis', ['default']);
};