-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathGruntfile.js
124 lines (119 loc) · 3.55 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
module.exports = function (grunt) {
var browsers = [
// chrome
{
browserName: "chrome",
platform: "OS X 10.9",
version: "38.0"
}, {
browserName: "chrome",
platform: "Windows 8.1",
version: "30.0"
}, {
browserName: "chrome",
platform: "Windows 10",
version: "51.0"
}, {
browserName: "chrome",
platform: "Windows 10",
version: "54.0"
},
// firefox
{
browserName: "firefox",
platform: "Windows 7",
version: "17.0"
}, {
browserName: "firefox",
platform: "Linux",
version: "35.0"
}, {
browserName: "firefox",
platform: "Linux",
version: "45.0"
},
// internet explorer
{
browserName: "internet explorer",
platform: "Windows 7",
version: "9.0"
}, {
browserName: "internet explorer",
platform: "Windows 8.1",
version: "11.0"
},
// edge
{
browserName: "MicrosoftEdge",
platform: "Windows 10",
version: "14.14393"
},
// safari
{
browserName: "safari",
platform: "OS X 10.11",
version: "9.0"
}];
grunt.initConfig({
uglify: {
target: {
files: {
'src/justlazy.min.js': ['src/justlazy.js']
}
}
},
jshint: {
files: [
"Gruntfile.js",
"src/justlazy.js",
"spec/**/*.js"
]
},
jasmine: {
src: "src/justlazy.js",
options: {
vendor: [
"jasmine-standalone/lib/jasmine-jquery-2.0.7/jquery.js",
"jasmine-standalone/lib/jasmine-jquery-2.0.7/jasmine-jquery.js",
"jasmine-standalone/phantomjs-config.js"
],
specs: "spec/**/*.js"
}
},
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
"saucelabs-jasmine": {
all: {
options: {
urls: ["http://127.0.0.1:9999/jasmine-standalone/SpecRunner.html"],
build: process.env.TRAVIS_JOB_ID,
browsers: browsers,
testname: "justlazy.js tests",
"max-duration": 300,
tags: ["master"]
}
}
},
watch: {}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-jasmine");
grunt.loadNpmTasks("grunt-saucelabs");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask("server", ["connect", "watch"]);
grunt.registerTask("minify", ["uglify"]);
grunt.registerTask("test-jshint", ["jshint"]);
grunt.registerTask("test-jasmine", ["jasmine"]);
grunt.registerTask("test-browsers", ["connect", "saucelabs-jasmine"]);
grunt.registerTask("test-all", ["jshint", "jasmine", "connect", "saucelabs-jasmine"]);
grunt.registerTask("travis-ci", ["test-all"]);
grunt.registerTask("default", ["test-jshint", "test-jasmine", "minify"]);
};