-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
90 lines (85 loc) · 2.47 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
var url = require('url');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
var browsers = [{
browserName: 'chrome'
}, {
browserName: 'chrome',
version: 'beta'
}, {
browserName: 'chrome',
version: '31'
}, {
browserName: 'chrome',
version: '26'
}, {
browserName: 'internet explorer',
version: '10'
}, {
browserName: 'internet explorer',
version: '11'
}, {
browserName: 'firefox'
}, {
browserName: 'firefox',
version: 'beta'
}, {
browserName: 'safari',
platform: 'OS X 10.10'
}, {
browserName: 'opera'
}];
grunt.initConfig({
connect: {
server: {
options: {
base: '',
port: 9999,
middleware: function(connect, options, middlewares) {
// inject a custom middleware into the array of default middlewares
middlewares.unshift(function(req, res, next) {
var parsedUrl = url.parse(req.url, true);
var query = parsedUrl.query;
var ttf = query.ttf || 400;
setTimeout(next, ttf);
});
return middlewares;
},
}
}
},
'saucelabs-jasmine': {
all: {
options: {
urls: ['http://127.0.0.1:9999/test/index.html'],
tunnelTimeout: 5,
build: process.env.TRAVIS_JOB_ID,
concurrency: 3,
statusCheckAttempts: 150,
browsers: browsers,
testname: 'bigpipe.js tests',
tags: ['ci', process.env.TRAVIS_BRANCH]
}
}
},
watch: {
scripts: {
files: ['lib/*.js'],
tasks: ['jsdoc'],
options: {
spawn: false,
},
},
},
jsdoc: {
dist: {
src: ['lib/*.js'],
options: {
destination: 'doc'
}
}
}
});
grunt.registerTask('dev', ['connect', 'jsdoc', 'watch']);
grunt.registerTask('test', ['connect', 'saucelabs-jasmine']);
};