Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

test(filters): fix timezone-dependent test #4333

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/ng/filter/filtersSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ describe('filters', function() {
});

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

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