-
Notifications
You must be signed in to change notification settings - Fork 32
/
Gruntfile.js
62 lines (54 loc) · 1.7 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
var which = require('which');
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
all: [
'*.js',
'activity/**/*.js',
'graphics/**/*.js',
'test/**/*.js']
},
karma: {
unit: {
configFile: 'test/karma-unit.conf.js',
browsers: ['Chrome'],
singleRun: true
},
functional: {
configFile: 'test/karma-functional.conf.js',
browsers: ['Chrome'],
singleRun: true
}
},
jsbeautifier: {
mode: 'VERIFY_ONLY',
files: [
'*.js',
'activity/**/*.js',
'graphics/**/*.js',
'test/**/*.js'],
options: {
js: {
jslintHappy: true,
keepArrayIndentation: true,
keepFunctionIndentation: true
}
}
}
});
grunt.registerTask('test', 'run automated tests', function () {
if (process.env.SUGAR_DEVELOPER) {
var browserPath = which.sync('sugar-web-test');
grunt.config('karma.unit.browsers', [browserPath]);
grunt.config('karma.functional.browsers', [browserPath]);
}
grunt.task.run('karma:unit');
if (process.env.SUGAR_DEVELOPER) {
grunt.task.run('karma:functional');
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.registerTask('default', ['jsbeautifier', 'jshint', 'test']);
};