-
Notifications
You must be signed in to change notification settings - Fork 11
/
Gruntfile.js
120 lines (112 loc) · 2.71 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
119
120
/* global module: false */
/* global require: false */
module.exports = function(grunt) {
// Project configuration.
grunt
.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsbeautifier: {
"default": {
src: ["Gruntfile.js", "d3/src/*.js",
"d3/js/AliTV.js", "d3/AliTV.html"
],
options: {
js: {
indent_with_tabs: true
}
}
},
"verify": {
src: ["Gruntfile.js", "d3/src/*.js",
"d3/js/AliTV.js"
],
options: {
mode: "VERIFY_ONLY",
js: {
indent_with_tabs: true
}
}
},
},
jasmine: {
components: {
src: ['d3/js/AliTV.js'],
options: {
'--local-to-remote-url-access': true,
specs: ['d3/test/spec/test_AliTV.js', 'd3/test/spec/test_getter_setter.js'],
vendor: ['d3/lib/jquery.min.js',
'd3/lib/d3.v3.min.js',
'd3/test/lib/jasmine-2.2.0/jasmine-jquery.js',
'd3/lib/textures.min.js',
'd3/lib/colorpicker/bootstrap-colorpicker.min.js',
'd3/lib/bootstrap.min.js',
'd3/lib/bootbox.min.js'
],
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'd3/test/coverage/coverage.json',
report: {
type: 'lcov',
options: {
dir: 'd3/test/coverage'
}
},
thresholds: {
lines: 75,
statements: 75,
branches: 75,
functions: 90
}
},
helpers: ['d3/test/helpers/defaultConf.js',
'd3/test/helpers/eventHelper.js',
'd3/test/helpers/customMatchers.js',
'd3/test/data/testData.js'
]
// keepRunner : true
}
}
},
jshint: {
options: {
undef: true,
esversion: 6,
globals: {
jQuery: true
}
},
all: ['Gruntfile.js', 'd3/js/AliTV.js']
},
jsdoc: {
dist: {
src: ['d3/js/AliTV.js'],
options: {
destination: 'd3/doc'
}
}
},
coveralls: {
all: {
// LCOV coverage file relevant to every target
src: 'd3/test/coverage/lcov.info',
options: {
force: false
}
}
}
});
// Load the plugins that provides the different tasks.
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks('grunt-istanbul-coverage');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-coveralls');
// Default task(s).
grunt.registerTask('default', ['make', 'test']);
grunt.registerTask('make', ['jsbeautifier:default', 'jsdoc']);
grunt.registerTask('test', ['jsbeautifier:verify', 'jshint', 'jasmine']);
grunt.registerTask('travis', ['jsbeautifier:verify', 'jshint', 'jasmine',
'coveralls'
]);
};