Skip to content

Commit 43660d4

Browse files
committed
On CI, adding a couple of browsers/platforms to run tests on (using Sauce Labs).
Closes js-cookie#192.
1 parent 939e3fd commit 43660d4

File tree

5 files changed

+74
-11
lines changed

5 files changed

+74
-11
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
build
3-
.sizecache.json
3+
.sizecache.json
4+
*.log

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
language: node_js
22
node_js:
3-
- 0.8
3+
- 0.8
44
before_script:
5-
- npm install -g grunt-cli
6-
script: grunt ci --verbose
5+
- npm install -g grunt-cli
6+
script: grunt ci --verbose
7+
env:
8+
global:
9+
- secure: FjCPTpIs6l6zTvXqH9rPTXqeRCpNa0cmz2Glio8fmOhbdeNbAdQTZGPChe8wTqIQ4wRQUtg4BPZjYx4+ibhj530/QW+736d9UUX5MhixCbm9r6EzRuljlo0wGRsLRa3pHIKyxq18bdilBSYaPrbekpLSyCKM/3wJa34k8LNKdrg=
10+
- secure: dJU6/DdQkuhVNSuaR1OswON7cHjRR7mDv0szIZ1rY/TRNoL6GrDr7XGpeQAtV+6Pqu1RJWb1V0VHoPble6imYqWtiq9LZu8UtU/ImKkZWZxFgMyDDJEli4Lw/+p1UMBNf7jXM3v8t9aOA0eHTwX7IA++paNIdehBOyNI8x3t6Ng=

Gruntfile.js

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,69 @@ module.exports = function (grunt) {
4747
}
4848
}
4949
}
50+
},
51+
connect: {
52+
server: {
53+
options: {
54+
base: '.',
55+
directory: 'test',
56+
port: 9999
57+
}
58+
}
59+
},
60+
'saucelabs-qunit': {
61+
all: {
62+
options: {
63+
urls: ['http://127.0.0.1:9999/test/index.html'],
64+
tunnelTimeout: 5,
65+
build: process.env.TRAVIS_JOB_ID,
66+
concurrency: 3,
67+
browsers: [
68+
{
69+
browserName: 'safari',
70+
platform: 'OS X 10.8'
71+
},
72+
{
73+
browserName: 'firefox',
74+
platform: 'Windows 7'
75+
},
76+
{
77+
browserName: 'firefox',
78+
platform: 'Windows XP'
79+
},
80+
{
81+
browserName: 'firefox',
82+
platform: 'Linux'
83+
},
84+
{
85+
browserName: 'chrome',
86+
platform: 'Windows 7'
87+
},
88+
{
89+
browserName: 'internet explorer',
90+
platform: 'Windows 8',
91+
version: '10'
92+
},
93+
{
94+
browserName: 'internet explorer',
95+
platform: 'Windows 7',
96+
version: '9'
97+
}
98+
],
99+
testname: 'jquery.cookie qunit tests'
100+
}
101+
}
50102
}
51103
});
52104

53-
grunt.loadNpmTasks('grunt-contrib-jshint');
54-
grunt.loadNpmTasks('grunt-contrib-uglify');
55-
grunt.loadNpmTasks('grunt-contrib-qunit');
56-
grunt.loadNpmTasks('grunt-contrib-watch');
57-
grunt.loadNpmTasks('grunt-compare-size');
105+
// Loading dependencies
106+
for (var key in grunt.file.readJSON('package.json').devDependencies) {
107+
if (key !== 'grunt' && key.indexOf('grunt') === 0) {
108+
grunt.loadNpmTasks(key);
109+
}
110+
}
58111

59112
grunt.registerTask('default', ['jshint', 'qunit', 'uglify', 'compare_size']);
60-
grunt.registerTask('ci', ['jshint', 'qunit']);
113+
grunt.registerTask('saucelabs', ['connect', 'saucelabs-qunit']);
114+
grunt.registerTask('ci', ['jshint', 'qunit', 'saucelabs']);
61115
};

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# jquery.cookie [![Build Status](https://travis-ci.org/carhartl/jquery-cookie.png?branch=master)](https://travis-ci.org/carhartl/jquery-cookie)
22

3+
[![Selenium Test Status](https://saucelabs.com/browser-matrix/carhartl.svg)](https://saucelabs.com/u/carhartl)
4+
35
A simple, lightweight jQuery plugin for reading, writing and deleting cookies.
46

57
## Installation

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
"gitHead": "bd3c9713222bace68d25fe2128c0f8633cad1269",
1919
"readmeFilename": "README.md",
2020
"devDependencies": {
21-
"grunt": "~0.4.0",
21+
"grunt": "~0.4.1",
2222
"grunt-contrib-jshint": "~0.4.0",
2323
"grunt-contrib-uglify": "~0.2.0",
2424
"grunt-contrib-qunit": "~0.2.0",
2525
"grunt-contrib-watch": "~0.3.0",
2626
"grunt-compare-size": "~0.4.0",
27+
"grunt-saucelabs": "~4.1.1",
28+
"grunt-contrib-connect": "~0.5.0",
2729
"gzip-js": "~0.3.0"
2830
}
2931
}

0 commit comments

Comments
 (0)