-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgruntfile.js
134 lines (114 loc) · 4.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
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
121
122
123
124
125
126
module.exports = function(grunt) {
var gruntconfig = {
jshint: {
all: [
'Gruntfile.js',
'tasks/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
debug: {
options: {
open: true // do not open node-inspector in Chrome automatically
}
},
jasmine: {
test: {
options: {
specs: './js/tests/spec/*.js',
helpers: ['./js/tests/helpers/*.js', './js/tests/lib/sinon/sinon.js'],
template: require('grunt-template-jasmine-dojo'),
templateOptions: {
dojoConfig: {
async: true,
has: { 'native-xhr2': false },
paths: {
app: '/../js'
}
},
dojoFile: 'http://js.arcgis.com/3.11/'
}
}
},
coverage: {
src: ['js/*.js', 'js/tasks/*.js'],
options: {
specs: ['./js/tests/spec/*.js'],
helpers: ['./js/tests/helpers/*.js', './js/tests/lib/sinon/sinon.js'],
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/coverage.json',
report: 'coverage',
srcCopy: ['js/templates/Nearest.html', 'js/templates/NearestItem.html', 'js/templates/NearestLayer.html', 'js/nls/Nearest.js', 'js/nls/en-gb/Nearest.js'],
template: require('grunt-template-jasmine-dojo'),
templateOptions: {
dojoConfig: {
async: true,
has: { 'native-xhr2': false },
paths: {
app: '/../.grunt/grunt-contrib-jasmine/js'
}
},
dojoFile: 'http://js.arcgis.com/3.11/'
}
}
}
},
coverageci: {
src: ['js/*.js', 'js/tasks/*.js'],
options: {
specs: ['./js/tests/spec/*.js'],
helpers: ['./js/tests/helpers/*.js', './js/tests/lib/sinon/sinon.js'],
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/coverage.json',
report: {
type: 'lcov',
options: {
dir: 'coverage/lcov'
}
},
srcCopy: ['js/templates/Nearest.html', 'js/templates/NearestItem.html', 'js/templates/NearestLayer.html', 'js/nls/Nearest.js', 'js/nls/en-gb/Nearest.js'],
template: require('grunt-template-jasmine-dojo'),
templateOptions: {
dojoConfig: {
async: true,
has: { 'native-xhr2': false },
paths: {
app: '/../.grunt/grunt-contrib-jasmine/js'
}
},
dojoFile: 'http://js.arcgis.com/3.11/'
}
}
}
}
},
coveralls: {
options: {
// LCOV coverage file relevant to every target
src: 'coverage/lcov/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: true
},
dijit_coverage: {
src: 'coverage/lcov/lcov.info'
}
}
};
// Project configuration.
grunt.initConfig(gruntconfig);
// Load grunt tasks
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-coveralls');
// Add default task(s)
grunt.registerTask('default', ['jasmine:test']);
grunt.registerTask('cover', ['jasmine:coverage']);
grunt.registerTask('travis', ['jasmine:coverageci']);
};