-
Notifications
You must be signed in to change notification settings - Fork 38
/
Gruntfile.js
80 lines (71 loc) · 3.16 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
/*global module, process*/
"use strict";
module.exports = function(grunt) {
var browsers = [
{platform: "linux", browserName: "chrome", version: "34"},
{platform: "linux", browserName: "firefox", version: "29"},
{platform: "WIN8.1", browserName: "firefox", version: "29"},
{platform: "WIN8.1", browserName: "chrome", version: "34"},
{platform: "WIN8.1", browserName: "internet explorer", version: "11"},
{platform: "WIN8", browserName: "internet explorer", version: "10"},
{platform: "WIN7", browserName: "internet explorer", version: "9"},
{platform: "WIN7", browserName: "internet explorer", version: "10"},
{platform: "VISTA", browserName: "internet explorer", version: "9"},
{platform: "OS X 10.8", browserName: "safari", version: "6"},
{platform: "OS X 10.8", browserName: "chrome", version: "34"},
{platform: "OS X 10.9", browserName: "chrome", version: "34"},
{platform: "OS X 10.9", browserName: "safari", version: "7"},
{platform: "OS X 10.9", browserName: "firefox", version: "28"},
{platform: "OS X 10.9", browserName: "iphone", version: "7.1"},
{platform: "linux", browserName: "android", version: "4.3"}
];
grunt.initConfig({
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
"saucelabs-jasmine": {
all: {
options: {
urls: ["http://127.0.0.1:9999/jasmine/SpecRunner.html"],
tunnelTimeout: 5,
build: process.env.TRAVIS_JOB_ID,
concurrency: 3,
browsers: browsers,
testname: "iSat Unit tests",
tags: ["master"],
sauceConfig: {
"video-upload-on-pass": false
},
onTestComplete: function(result){
/* returning undefined doesn't alter the test result
but returning true or false does.
See: https://github.com/axemclion/grunt-saucelabs
We return true if result.passed is undefined to
gloss over spurious errors from saucelabs.
See: https://github.com/admc/wd/issues/86 which is
all I could find about it.
Everything else gets unaltered results.
*/
if (result.passed === undefined) {
return true;
} else {
return undefined;
}
}
}
}
},
watch: {}
});
// Loading dependencies
for (var key in grunt.file.readJSON("package.json").devDependencies) {
if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key);
}
grunt.registerTask("dev", ["connect", "watch"]);
grunt.registerTask("test", ["connect", "saucelabs-jasmine"]);
};