Skip to content

Commit

Permalink
Add Date#{getUTCDate,getUTCMonth} tests to expose Opera 10.6/11.61/…
Browse files Browse the repository at this point in the history
…12 `Date bugs
  • Loading branch information
ljharb committed Jun 21, 2015
1 parent 21f2c44 commit f05e423
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/spec/s-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,25 @@ describe('Date', function () {
});
});

describe('getUTCDate', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
expect(new Date(-3509827334573292).getUTCDate()).toBe(1);
});
});

describe('getUTCMonth', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
expect(new Date(-3509827334573292).getUTCMonth()).toBe(0);
});

it('should return correct values', function () {
expect(new Date(8.64e15).getUTCMonth()).toBe(8);
expect(new Date(0).getUTCMonth()).toBe(0);
});
});

describe('toISOString', function () {
// TODO: write the rest of the test.

Expand Down

0 comments on commit f05e423

Please sign in to comment.