Skip to content

Commit

Permalink
fix date test running in other offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
nruffing committed Jan 13, 2024
1 parent ff1ed9e commit 2069024
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 77 deletions.
76 changes: 0 additions & 76 deletions lib/DataService.spec.ts

This file was deleted.

3 changes: 2 additions & 1 deletion lib/DateUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ describe('justADatePlease', () => {

test('date with offset rollover on day', () => {
const date = new Date(2021, 0, 1, 22, 2, 3, 4)
expect(justADatePlease(date)).toEqual(new Date(Date.UTC(2021, 0, 2, 0, 0, 0, 0)))
const expectedDate = date.getTimezoneOffset() > 120 ? 2 : 1
expect(justADatePlease(date)).toEqual(new Date(Date.UTC(2021, 0, expectedDate, 0, 0, 0, 0)))
})
})

Expand Down

0 comments on commit 2069024

Please sign in to comment.