Skip to content

Commit 8b2a880

Browse files
committed
Try making expires related test more fail-safe
I was seeing an error due to a used expires date coming after the upcoming DST change. Reducing the days we move forward should at least reduce the likelihood that the test fails.
1 parent 0875b1c commit 8b2a880

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ QUnit.test('undefined', function (assert) {
180180

181181
QUnit.test('expires option as days from now', function (assert) {
182182
assert.expect(1);
183-
var sevenDaysFromNow = new Date();
184-
sevenDaysFromNow.setDate(sevenDaysFromNow.getDate() + 21);
185-
var expected = 'expires=' + sevenDaysFromNow.toUTCString();
186-
var actual = Cookies.set('c', 'v', { expires: 21 });
183+
var expires = new Date();
184+
expires.setDate(expires.getDate() + 1);
185+
var expected = 'expires=' + expires.toUTCString();
186+
var actual = Cookies.set('c', 'v', { expires: 1 });
187187
assert.ok(actual.indexOf(expected) !== -1, quoted(actual) + ' includes ' + quoted(expected));
188188
});
189189

0 commit comments

Comments
 (0)