Skip to content

Commit

Permalink
test: Check if valueOf() is correct across DST
Browse files Browse the repository at this point in the history
  • Loading branch information
Nam PHAM committed Dec 9, 2021
1 parent f979468 commit 92d8782
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/plugin/timezone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const NY = 'America/New_York'
const VAN = 'America/Vancouver'
const DEN = 'America/Denver'
const TOKYO = 'Asia/Tokyo'
const PARIS = 'Europe/Paris'

describe('Guess', () => {
it('return string', () => {
Expand Down Expand Up @@ -212,6 +213,18 @@ describe('DST, a time that never existed Fall Back', () => {
})
})

it('DST valueOf', () => {
const day1 = '2021-11-17T09:45:00.000Z'
const d1 = dayjs.utc(day1).tz(PARIS)
const m1 = moment.tz(day1, PARIS)
expect(d1.valueOf()).toBe(m1.valueOf())

const day2 = '2021-05-17T09:45:00.000Z'
const d2 = dayjs.utc(day2).tz(PARIS)
const m2 = moment.tz(day2, PARIS)
expect(d2.valueOf()).toBe(m2.valueOf())
})

describe('set Default', () => {
it('default timezone', () => {
const dateStr = '2014-06-01 12:00'
Expand Down

0 comments on commit 92d8782

Please sign in to comment.