Skip to content

Commit 6d83c7b

Browse files
committed
verify our test environment has DST
1 parent 9c645e7 commit 6d83c7b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/jasmine/tests/lib_date_test.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,13 @@ describe('dates', function() {
145145
it('should interpret JS dates by local time, not by its getTime()', function() {
146146
// not really part of the test, just to make sure the test is meaningful
147147
// the test should NOT be run in a UTC environment
148-
expect([
149-
Number(new Date(1970, 0, 1)),
150-
Number(new Date(1970, 6, 1))
151-
]).not.toEqual([0, JULY1MS]);
148+
var local0 = Number(new Date(1970, 0, 1)),
149+
localjuly1 = Number(new Date(1970, 6, 1));
150+
expect([local0, localjuly1]).not.toEqual([0, JULY1MS],
151+
'test must not run in UTC');
152+
// verify that there *is* daylight saving time in the test environment
153+
expect(localjuly1 - local0).not.toEqual(JULY1MS - 0,
154+
'test must run in a timezone with DST');
152155

153156
// now repeat the previous test and show that we throw away
154157
// timezone info from js dates

0 commit comments

Comments
 (0)