Skip to content

Commit 8fed588

Browse files
Merge pull request js-cookie#5 from js-cookie/2.0
Version 2.0.0-beta.1
2 parents 95fbfc7 + 6d7b290 commit 8fed588

19 files changed

+977
-686
lines changed

.jshintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"undef": true,
1010
"unused": true,
1111
"globals": {
12-
"Cookies": true,
13-
"require": true
12+
"Cookies": true
1413
}
1514
}

.travis.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
language: node_js
2-
node_js:
3-
- '0.10'
4-
before_script:
5-
- npm install -g grunt-cli
6-
# Only use grunt-ci for commits pushed to this repo. Fall back to regular test
7-
# for pull requests (as secure variables won't be exposed there).
8-
script:
9-
- ./travis.sh
10-
env:
11-
# Encrypted SAUCE_USERNAME and SAUCE_ACCESS_KEY used by travis
12-
global:
13-
- secure: IkMOa/8r4sWyzUMxecsfqoPzZyIqVAMwPkQ6/HxXPbT8X7UnvqAdaicAMeHEKtOnOac+rx6pGB9HQvC8P/ZzkEBtsKLP4nEh9vsAInZvb3pXg+qbIgIK6/19X0kU4UkpDqVdWmBuFTamJvMDMstUTgEaM3869bB5vGp9taBgfVo=
14-
- secure: DKrQplF0CBiBh+cbQ8D7EKebCeklUWEELblIJdU4475Occ4G9b8ZFYO9HFwl1B8F/XapB7CsMyxbJCWor030FySeqn8bhJs9NoAVoYGg+MtWniv1EOHuZLWuOGfgQDv7qj5U0Af9Y655MmUpXSN2aDlCmQweWnYdpFTM9Dfsdd8=
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
before_script:
5+
- npm install -g grunt-cli
6+
# Only use grunt-ci for commits pushed to this repo. Fall back to regular test
7+
# for pull requests (as secure variables won't be exposed there).
8+
script:
9+
- ./travis.sh
10+
env:
11+
# Encrypted SAUCE_USERNAME and SAUCE_ACCESS_KEY used by travis
12+
global:
13+
- secure: IkMOa/8r4sWyzUMxecsfqoPzZyIqVAMwPkQ6/HxXPbT8X7UnvqAdaicAMeHEKtOnOac+rx6pGB9HQvC8P/ZzkEBtsKLP4nEh9vsAInZvb3pXg+qbIgIK6/19X0kU4UkpDqVdWmBuFTamJvMDMstUTgEaM3869bB5vGp9taBgfVo=
14+
- secure: DKrQplF0CBiBh+cbQ8D7EKebCeklUWEELblIJdU4475Occ4G9b8ZFYO9HFwl1B8F/XapB7CsMyxbJCWor030FySeqn8bhJs9NoAVoYGg+MtWniv1EOHuZLWuOGfgQDv7qj5U0Af9Y655MmUpXSN2aDlCmQweWnYdpFTM9Dfsdd8=

CHANGELOG.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Start a test server from the project root:
4141

4242
$ grunt connect:tests
4343

44-
This will automatically open the test suite at http://127.0.0.1:9998 in the default browser, with livereload enabled.
44+
This will automatically open the test suite at http://127.0.0.1:10000 in the default browser, with livereload enabled.
4545

4646
_Note: we recommend cleaning all the browser cookies before running the tests, that can avoid false positive failures._
4747

Gruntfile.js

Lines changed: 114 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*jshint node:true, quotmark:single */
1+
/*jshint node:true */
22
'use strict';
33

44
module.exports = function (grunt) {
@@ -22,7 +22,28 @@ module.exports = function (grunt) {
2222
},
2323
grunt: 'Gruntfile.js',
2424
source: 'src/**/*.js',
25-
tests: 'test/**/*.js'
25+
tests: ['test/**/*.js', '!test/polyfill.js']
26+
},
27+
jscs: {
28+
options: {
29+
requireCommaBeforeLineBreak: true,
30+
requireLineFeedAtFileEnd: true,
31+
requireSemicolons: true,
32+
requireSpaceBeforeKeywords: ['else', 'while', 'catch'],
33+
requireSpaceAfterKeywords: true,
34+
requireSpaceAfterLineComment: true,
35+
requireSpaceBeforeBlockStatements: true,
36+
requireSpaceBeforeObjectValues: true,
37+
validateIndentation: '\t',
38+
validateLineBreaks: 'LF',
39+
validateQuoteMarks: true,
40+
disallowSpacesInsideArrayBrackets: 'all',
41+
disallowSpacesInsideParentheses: true,
42+
disallowTrailingWhitespace: true
43+
},
44+
grunt: 'Gruntfile.js',
45+
source: 'src/**/*.js',
46+
tests: ['test/**/*.js', '!test/polyfill.js']
2647
},
2748
uglify: {
2849
options: {
@@ -55,23 +76,23 @@ module.exports = function (grunt) {
5576
}
5677
},
5778
connect: {
58-
saucelabs: {
79+
'build-sauce': {
5980
options: {
6081
port: 9999,
6182
base: ['.', 'test']
6283
}
6384
},
64-
build: {
85+
'build-qunit': {
6586
options: {
6687
port: 9998,
6788
base: ['.', 'test']
6889
}
6990
},
7091
tests: {
7192
options: {
72-
port: 9998,
93+
port: 10000,
7394
base: ['.', 'test'],
74-
open: 'http://127.0.0.1:9998',
95+
open: 'http://127.0.0.1:10000',
7596
keepalive: true,
7697
livereload: true
7798
}
@@ -83,89 +104,92 @@ module.exports = function (grunt) {
83104
urls: ['http://127.0.0.1:9999'],
84105
testname: 'Sauce Test for js-cookie',
85106
build: process.env.TRAVIS_JOB_ID,
86-
pollInterval: 5000,
87-
browsers: [
88-
// iOS
89-
{
90-
browserName: 'iphone',
91-
platform: 'OS X 10.9',
92-
version: '7.1'
93-
},
94-
{
95-
browserName: 'ipad',
96-
platform: 'OS X 10.9',
97-
version: '7.1'
98-
},
99-
// Android
100-
{
101-
browserName: 'android',
102-
platform: 'Linux',
103-
version: '4.3'
104-
},
105-
// OS X
106-
{
107-
browserName: 'safari',
108-
platform: 'OS X 10.9',
109-
version: '7'
110-
},
111-
{
112-
browserName: 'safari',
113-
platform: 'OS X 10.8',
114-
version: '6'
115-
},
116-
{
117-
browserName: 'firefox',
118-
platform: 'OS X 10.9',
119-
version: '28'
120-
},
121-
// Windows
122-
{
123-
browserName: 'internet explorer',
124-
platform: 'Windows 8.1',
125-
version: '11'
126-
},
127-
{
128-
browserName: 'internet explorer',
129-
platform: 'Windows 8',
130-
version: '10'
131-
},
132-
{
133-
browserName: 'internet explorer',
134-
platform: 'Windows 7',
135-
version: '11'
136-
},
137-
{
138-
browserName: 'internet explorer',
139-
platform: 'Windows 7',
140-
version: '10'
141-
},
142-
{
143-
browserName: 'internet explorer',
144-
platform: 'Windows 7',
145-
version: '9'
146-
},
147-
{
148-
browserName: 'internet explorer',
149-
platform: 'Windows 7',
150-
version: '8'
151-
},
152-
{
153-
browserName: 'firefox',
154-
platform: 'Windows 7',
155-
version: '29'
156-
},
157-
{
158-
browserName: 'chrome',
159-
platform: 'Windows 7',
160-
version: '34'
161-
},
162-
// Linux
163-
{
164-
browserName: 'firefox',
165-
platform: 'Linux',
166-
version: '29'
107+
pollInterval: 10000,
108+
statusCheckAttempts: 90,
109+
throttled: 3,
110+
browsers: (function() {
111+
var browsers = {
112+
'iOS': [{
113+
browserName: 'iphone',
114+
platform: 'OS X 10.10',
115+
version: '8.2',
116+
deviceName: 'iPhone Simulator'
117+
}, {
118+
browserName: 'iphone',
119+
platform: 'OS X 10.10',
120+
version: '8.2',
121+
deviceName: 'iPad Simulator'
122+
}],
123+
'android': [{
124+
browserName: 'android',
125+
platform: 'Linux',
126+
version: '5.1',
127+
deviceName: 'Android Emulator'
128+
}],
129+
'mac': [{
130+
browserName: 'safari',
131+
platform: 'OS X 10.10',
132+
version: '8.0'
133+
}, {
134+
browserName: 'firefox',
135+
platform: 'OS X 10.10',
136+
version: '36.0'
137+
}, {
138+
browserName: 'chrome',
139+
platform: 'OS X 10.10',
140+
versiono: '41.0'
141+
}],
142+
'windows7': [{
143+
browserName: 'internet explorer',
144+
platform: 'Windows 7',
145+
version: '11.0'
146+
}, {
147+
browserName: 'internet explorer',
148+
platform: 'Windows 7',
149+
version: '10.0'
150+
}, {
151+
browserName: 'internet explorer',
152+
platform: 'Windows 7',
153+
version: '9.0'
154+
}, {
155+
browserName: 'opera',
156+
platform: 'Windows 7',
157+
version: '12.12'
158+
}],
159+
'windowsXP': [{
160+
browserName: 'internet explorer',
161+
platform: 'Windows XP',
162+
version: '8.0'
163+
}, {
164+
browserName: 'internet explorer',
165+
platform: 'Windows XP',
166+
version: '7.0'
167+
}, {
168+
browserName: 'internet explorer',
169+
platform: 'Windows XP',
170+
version: '6.0'
171+
}],
172+
'linux': [{
173+
browserName: 'opera',
174+
platform: 'Linux',
175+
version: '12.15'
176+
}, {
177+
browserName: 'firefox',
178+
platform: 'Linux',
179+
version: '37.0'
180+
}, {
181+
browserName: 'chrome',
182+
platform: 'Linux',
183+
version: '41.0'
184+
}]
185+
};
186+
187+
var matrix = [];
188+
for ( var os in browsers ) {
189+
matrix = matrix.concat(browsers[os]);
167190
}
168-
]
191+
return matrix;
192+
}())
169193
}
170194
}
171195
}
@@ -178,8 +202,8 @@ module.exports = function (grunt) {
178202
}
179203
}
180204

181-
grunt.registerTask('saucelabs', ['connect:saucelabs', 'saucelabs-qunit']);
182-
grunt.registerTask('test', ['jshint', 'connect:build', 'qunit', 'nodeunit']);
205+
grunt.registerTask('saucelabs', ['connect:build-sauce', 'saucelabs-qunit']);
206+
grunt.registerTask('test', ['jshint', 'connect:build-qunit', 'qunit', 'nodeunit']);
183207

184208
grunt.registerTask('dev', ['test', 'uglify', 'compare_size']);
185209
grunt.registerTask('ci', ['test', 'saucelabs']);

0 commit comments

Comments
 (0)