Skip to content

Commit c89c3c3

Browse files
btfordjamesdaily
authored andcommitted
test(filters): fix timezone-dependent test
Closes angular#4218
1 parent 1daca8d commit c89c3c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/ng/filter/filtersSpec.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ describe('filters', function() {
247247
});
248248

249249
it('should accept negative numbers as strings', function() {
250-
expect(date('-1')).toEqual('Dec 31, 1969');
250+
//Note: this tests a timestamp set for 3 days before the unix epoch.
251+
//The behavior of `date` depends on your timezone, which is why we check just
252+
//the year and not the whole daye. See Issue #4218
253+
expect(date('-259200000').split(' ')[2]).toEqual('1969');
251254
});
252255

253256
it('should format timezones correctly (as per ISO_8601)', function() {

0 commit comments

Comments
 (0)