Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more test to fix utcOffset DST #1

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

NamPNQ
Copy link

@NamPNQ NamPNQ commented Dec 8, 2021

No description provided.

@NamPNQ NamPNQ changed the title Add more test Add more test to fix utcOffset DST Dec 8, 2021
Copy link
Owner

@aloisklink aloisklink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for adding the test to my PR.

Unfortunately, tests are failing. I think you added tests to the wrong file, it should be test/plugin/timezone.test.js. You also need to add the const PARIS = 'Europe/Paris' line.

Dayjs also wants semantic commits, so should name your commit something like:

test: Check if valueOf() is correct across DST

Failing test results:

me@me: ~/dayjs$ npm test
dayjs@0.0.0-development test /home/user/dayjs
...
 FAIL  test/timezone.test.js
  ✓ Add Time days (DST) (9ms)
  ✓ Utc Offset
  ✓ Diff (DST) (6ms)
  ✓ UTC add day in DST (1ms)
  ✓ UTC and utcOffset (2ms)
  ✕ DST valueOf (11ms)
  ✓ UTC diff in DST

  ● DST valueOf

    ReferenceError: PARIS is not defined

      76 | it('DST valueOf', () => {
      77 |   const day1 = '2021-11-17T09:45:00.000Z'
    > 78 |   const d1 = dayjs.utc(day1).tz(PARIS)
      79 |   const m1 = moment.tz(day1, PARIS)
      80 |   expect(d1.valueOf()).toBe(m1.valueOf())
      81 |
      
      at Object.<anonymous> (test/timezone.test.js:78:33)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 6 passed, 7 total
Snapshots:   0 total
Time:        1.63s

@NamPNQ
Copy link
Author

NamPNQ commented Dec 9, 2021

Thank you, I have updated my PR

Copy link
Owner

@aloisklink aloisklink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for making the changes 👍

@aloisklink aloisklink merged commit c400f3c into aloisklink:fix-utcOffset-dst Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants