-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGruntfile.js
More file actions
85 lines (80 loc) · 2.1 KB
/
Gruntfile.js
File metadata and controls
85 lines (80 loc) · 2.1 KB
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
var serveStatic = require('serve-static');
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
options: {
port: 8000,
hostname: '0.0.0.0',
base: '.',
keepalive: false,
middleware: function (connect, options) {
var middleware = [
function (req, res, next) {
if (req.method === 'GET') {
res.setHeader('Cache-control', 'public, max-age=3600');
}
next();
},
];
options.base.forEach(function (base) {
middleware.push(serveStatic(base));
});
return middleware;
}
},
test: {},
dev: {
options: {
keepalive: true
}
}
},
http: {
closure: {
options: {
url: 'http://closure-compiler.appspot.com/compile',
method: 'POST',
form: {
output_info: 'compiled_code',
output_format: 'text',
compilation_level: 'SIMPLE_OPTIMIZATIONS',
warning_level: 'default'
},
sourceField: 'form.js_code'
},
files: {
'angular-auto-value.min.js': 'angular-auto-value.js'
}
}
},
protractor: {
options: {
configFile: "test/conf.js",
keepAlive: false,
noColor: false
},
'stand-alone': {},
attach: {
options: {
args: {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub'
}
}
}
},
watch: {
protractor: {
files: ['angular-auto-value.js', 'test/*Spec.js'],
tasks: ['protractor:attach']
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-http');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('test', ['connect:test', 'protractor:stand-alone']);
grunt.registerTask('dev', ['connect:test', 'watch']);
grunt.registerTask('default', ['test', 'http:closure']);
};