File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -145,10 +145,13 @@ describe('dates', function() {
145
145
it ( 'should interpret JS dates by local time, not by its getTime()' , function ( ) {
146
146
// not really part of the test, just to make sure the test is meaningful
147
147
// 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' ) ;
152
155
153
156
// now repeat the previous test and show that we throw away
154
157
// timezone info from js dates
You can’t perform that action at this time.
0 commit comments