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

Tests failing: DST, a time that never existed #1056

Closed
tukusejssirs opened this issue Sep 17, 2020 · 2 comments
Closed

Tests failing: DST, a time that never existed #1056

tukusejssirs opened this issue Sep 17, 2020 · 2 comments

Comments

@tukusejssirs
Copy link
Contributor

Describe the bug
npm test fails

Expected behavior
npm test succeeds

Information

  • Day.js Version: latest from dev branch (a882b20)
  • OS: Fedora 32 x86_64
  • Browser: irrelevant
  • Time zone: CE(S)T (GMT+1, GMT+2)

2 test suits / 10 tests fail with the following errors:

  • DST, a time that never existed Fall Back;
  • change hours when changing the utc offset in UTC mode;
  • keep hours when adding month in offset mode.
npm test
$ npm test

> dayjs@0.0.0-development test /home/ts/dayjs
> TZ=Pacific/Auckland npm run test-tz && TZ=Europe/London npm run test-tz && TZ=America/Whitehorse npm run test-tz && npm run test-tz && jest


> dayjs@0.0.0-development test-tz /home/ts/dayjs
> date && jest test/timezone.test --coverage=false

Fri 18 Sep 07:56:14 NZST 2020
 PASS  test/timezone.test.js
  ✓ Add Time days (DST) (25ms)
  ✓ Utc Offset (1ms)
  ✓ Diff (DST) (10ms)
  ✓ UTC add day in DST (2ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        3.31s
Ran all test suites matching /test\/timezone.test/i.

> dayjs@0.0.0-development test-tz /home/ts/dayjs
> date && jest test/timezone.test --coverage=false

Thu 17 Sep 20:56:19 BST 2020
 PASS  test/timezone.test.js
  ✓ Add Time days (DST) (24ms)
  ✓ Utc Offset (1ms)
  ✓ Diff (DST) (10ms)
  ✓ UTC add day in DST (3ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.384s, estimated 3s
Ran all test suites matching /test\/timezone.test/i.

> dayjs@0.0.0-development test-tz /home/ts/dayjs
> date && jest test/timezone.test --coverage=false

Thu 17 Sep 12:56:21 MST 2020
 PASS  test/timezone.test.js
  ✓ Add Time days (DST) (16ms)
  ✓ Utc Offset (1ms)
  ✓ Diff (DST) (11ms)
  ✓ UTC add day in DST (3ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.337s
Ran all test suites matching /test\/timezone.test/i.

> dayjs@0.0.0-development test-tz /home/ts/dayjs
> date && jest test/timezone.test --coverage=false

Thu 17 Sep 21:56:23 CEST 2020
 PASS  test/timezone.test.js
  ✓ Add Time days (DST) (16ms)
  ✓ Utc Offset
  ✓ Diff (DST) (12ms)
  ✓ UTC add day in DST (2ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.409s
Ran all test suites matching /test\/timezone.test/i.
 PASS  test/plugin/isSameOrBefore.test.js (7.899s)
 PASS  test/comparison.test.js (7.909s)
 PASS  test/plugin/isBetween.test.js (8.106s)
 PASS  test/plugin/isSameOrAfter.test.js
 PASS  test/display.test.js
 PASS  test/plugin/objectSupport.test.js
 PASS  test/plugin/customParseFormat.test.js
 PASS  test/plugin/utc.test.js
 FAIL  test/plugin/timezone.test.js
  ● DST, a time that never existed Spring Forward › 2012-03-11 01:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T01:59:59-05:00"
    Received:
      "2012-03-11T00:59:59-05:00"

      122 |     const d = dayjs.tz(s, NY)
      123 |     const m = moment.tz(s, NY)
    > 124 |     expect(d.format()).toBe('2012-03-11T01:59:59-05:00')
      125 |     expect(d.format()).toBe(m.format())
      126 |     expect(d.utcOffset()).toBe(-300)
      127 |     expect(d.utcOffset()).toBe(m.utcOffset())
      
      at Object.<anonymous> (test/plugin/timezone.test.js:124:24)

  ● DST, a time that never existed Spring Forward › 2012-03-11 02:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T03:00:00-04:00"
    Received:
      "2012-03-11T02:00:00-04:00"

      133 |     const d = dayjs.tz(s, NY)
      134 |     const m = moment.tz(s, NY)
    > 135 |     expect(d.format()).toBe('2012-03-11T03:00:00-04:00')
      136 |     expect(d.format()).toBe(m.format())
      137 |     expect(d.valueOf()).toBe(m.valueOf())
      138 |     expect(d.valueOf()).toBe(1331449200000)
      
      at Object.<anonymous> (test/plugin/timezone.test.js:135:24)

  ● DST, a time that never existed Spring Forward › 2012-03-11 02:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T03:59:59-04:00"
    Received:
      "2012-03-11T02:59:59-04:00"

      144 |     const d = dayjs.tz(s, NY)
      145 |     const m = moment.tz(s, NY)
    > 146 |     expect(d.format()).toBe('2012-03-11T03:59:59-04:00')
      147 |     expect(d.format()).toBe(m.format())
      148 |     expect(d.valueOf()).toBe(m.valueOf())
      149 |     expect(d.valueOf()).toBe(1331452799000)
      
      at Object.<anonymous> (test/plugin/timezone.test.js:146:24)

  ● DST, a time that never existed Spring Forward › 2012-03-11 03:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T03:00:00-04:00"
    Received:
      "2012-03-11T02:00:00-04:00"

      155 |     const d = dayjs.tz(s, NY)
      156 |     const m = moment.tz(s, NY)
    > 157 |     expect(d.format()).toBe('2012-03-11T03:00:00-04:00')
      158 |     expect(d.format()).toBe(m.format())
      159 |     expect(d.valueOf()).toBe(m.valueOf())
      160 |     expect(d.valueOf()).toBe(1331449200000)
      
      at Object.<anonymous> (test/plugin/timezone.test.js:157:24)

  ● DST, a time that never existed Fall Back › 2012-11-04 00:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T00:59:59-04:00"
    Received:
      "2012-11-03T23:59:59-04:00"

      171 |     [dayjs, moment].forEach((_) => {
      172 |       const d = _.tz(s, NY)
    > 173 |       expect(d.format()).toBe('2012-11-04T00:59:59-04:00')
      174 |       expect(d.utcOffset()).toBe(-240)
      175 |       expect(d.valueOf()).toBe(1352005199000)
      176 |     })
      
      at forEach (test/plugin/timezone.test.js:173:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:171:21)

  ● DST, a time that never existed Fall Back › 2012-11-04 01:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T01:00:00-04:00"
    Received:
      "2012-11-04T00:00:00-04:00"

      180 |     [dayjs, moment].forEach((_) => {
      181 |       const d = _.tz(s, NY)
    > 182 |       expect(d.format()).toBe('2012-11-04T01:00:00-04:00')
      183 |       expect(d.utcOffset()).toBe(-240)
      184 |       expect(d.valueOf()).toBe(1352005200000)
      185 |     })
      
      at forEach (test/plugin/timezone.test.js:182:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:180:21)

  ● DST, a time that never existed Fall Back › 2012-11-04 01:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T01:59:59-04:00"
    Received:
      "2012-11-04T00:59:59-04:00"

      189 |     [dayjs, moment].forEach((_) => {
      190 |       const d = _.tz(s, NY)
    > 191 |       expect(d.format()).toBe('2012-11-04T01:59:59-04:00')
      192 |       expect(d.utcOffset()).toBe(-240)
      193 |       expect(d.valueOf()).toBe(1352008799000)
      194 |     })
      
      at forEach (test/plugin/timezone.test.js:191:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:189:21)

  ● DST, a time that never existed Fall Back › 2012-11-04 02:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T02:00:00-05:00"
    Received:
      "2012-11-04T01:00:00-05:00"

      198 |     [dayjs, moment].forEach((_) => {
      199 |       const d = _.tz(s, NY)
    > 200 |       expect(d.format()).toBe('2012-11-04T02:00:00-05:00')
      201 |       expect(d.utcOffset()).toBe(-300)
      202 |       expect(d.valueOf()).toBe(1352012400000)
      203 |     })
      
      at forEach (test/plugin/timezone.test.js:200:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:198:21)

 PASS  test/parse.test.js
 FAIL  test/plugin/utc-utcOffset.test.js
  ● change hours when changing the utc offset in UTC mode

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      5
    Received:
      4

      87 |   expect(d.hour()).toBe(6)
      88 |   expect(d.utcOffset(0).hour()).toBe(6)
    > 89 |   expect(d.utcOffset(-60).hour()).toBe(5)
      90 |   expect(d.utcOffset(60).hour()).toBe(7)
      91 |   expect(d.utcOffset(-30).format('HH:mm')).toBe('06:01')
      92 |   expect(d.utcOffset(30).format('HH:mm')).toBe('07:01')
      
      at Object.<anonymous> (test/plugin/utc-utcOffset.test.js:89:35)

  ● keep hours when adding month in offset mode

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      6
    Received:
      5

      111 |   const dm8 = dayjs('2000-01-30T06:31:00-08:00').utcOffset(-8)
      112 | 
    > 113 |   expect(d10.add(1, 'month').hour()).toBe(6)
      114 |   expect(dm8.add(1, 'month').hour()).toBe(6)
      115 | 
      116 |   expect(d10.add(-2, 'month').hour()).toBe(6)
      
      at Object.<anonymous> (test/plugin/utc-utcOffset.test.js:113:38)

 PASS  test/plugin/isoWeek.test.js
 PASS  test/plugin/duration.test.js
 PASS  test/plugin/pluralGetSet.test.js
 PASS  test/get-set.test.js
 PASS  test/locale.test.js
 PASS  test/plugin/badMutable.test.js
 PASS  test/plugin/relativeTime.test.js
 PASS  test/plugin/calendar.test.js
 PASS  test/manipulate.test.js
 PASS  test/plugin/localeData.test.js
 PASS  test/plugin/localizedFormat.test.js
 PASS  test/plugin/updateLocale.test.js
 PASS  test/plugin/advancedFormat.test.js
 PASS  test/locale/uk.test.js
 PASS  test/locale/pl.test.js
 PASS  test/plugin/quarterOfYear.test.js
 PASS  test/plugin/weekOfYear.test.js
 PASS  test/plugin/weekday.test.js
 PASS  test/utils.test.js
 PASS  test/locale/ru.test.js
 PASS  test/plugin/dayOfYear.test.js
 PASS  test/locale/fi.test.js
 PASS  test/locale/cs.test.js
 PASS  test/plugin/minMax.test.js
 PASS  test/locale/sk.test.js
 PASS  test/query.test.js
 PASS  test/plugin/buddhistEra.test.js
 PASS  test/locale/et.test.js
 PASS  test/plugin.test.js
 PASS  test/plugin/isoWeeksInYear.test.js
 PASS  test/locale/en.test.js
 PASS  test/locale/lt.test.js
 PASS  test/locale/hr.test.js
 PASS  test/plugin/weekYear.test.js
 PASS  test/locale/zh.test.js
 PASS  test/locale/sv.test.js
 PASS  test/locale/zh-cn.test.js
 PASS  test/plugin/isTomorrow.test.js
 PASS  test/plugin/isYesterday.test.js
 PASS  test/plugin/isLeapYear.test.js
 PASS  test/plugin/isToday.test.js
 PASS  test/plugin/toObject.test.js
 PASS  test/plugin/isMoment.test.js
 PASS  test/plugin/declarations.test.js
 PASS  test/plugin/toArray.test.js
 PASS  test/constructor.test.js
 PASS  test/timezone.test.js
 PASS  test/locale/keys.test.js (6.649s)
------------------------------|----------|----------|----------|----------|-------------------|
File                          |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
------------------------------|----------|----------|----------|----------|-------------------|
All files                     |      100 |    99.65 |      100 |      100 |                   |
 src                          |      100 |      100 |      100 |      100 |                   |
  constant.js                 |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
  utils.js                    |      100 |      100 |      100 |      100 |                   |
 src/locale                   |      100 |      100 |      100 |      100 |                   |
  af.js                       |      100 |      100 |      100 |      100 |                   |
  am.js                       |      100 |      100 |      100 |      100 |                   |
  ar-dz.js                    |      100 |      100 |      100 |      100 |                   |
  ar-kw.js                    |      100 |      100 |      100 |      100 |                   |
  ar-ly.js                    |      100 |      100 |      100 |      100 |                   |
  ar-ma.js                    |      100 |      100 |      100 |      100 |                   |
  ar-sa.js                    |      100 |      100 |      100 |      100 |                   |
  ar-tn.js                    |      100 |      100 |      100 |      100 |                   |
  ar.js                       |      100 |      100 |      100 |      100 |                   |
  az.js                       |      100 |      100 |      100 |      100 |                   |
  be.js                       |      100 |      100 |      100 |      100 |                   |
  bg.js                       |      100 |      100 |      100 |      100 |                   |
  bi.js                       |      100 |      100 |      100 |      100 |                   |
  bm.js                       |      100 |      100 |      100 |      100 |                   |
  bn.js                       |      100 |      100 |      100 |      100 |                   |
  bo.js                       |      100 |      100 |      100 |      100 |                   |
  br.js                       |      100 |      100 |      100 |      100 |                   |
  bs.js                       |      100 |      100 |      100 |      100 |                   |
  ca.js                       |      100 |      100 |      100 |      100 |                   |
  cs.js                       |      100 |      100 |      100 |      100 |                   |
  cv.js                       |      100 |      100 |      100 |      100 |                   |
  cy.js                       |      100 |      100 |      100 |      100 |                   |
  da.js                       |      100 |      100 |      100 |      100 |                   |
  de-at.js                    |      100 |      100 |      100 |      100 |                   |
  de-ch.js                    |      100 |      100 |      100 |      100 |                   |
  de.js                       |      100 |      100 |      100 |      100 |                   |
  dv.js                       |      100 |      100 |      100 |      100 |                   |
  el.js                       |      100 |      100 |      100 |      100 |                   |
  en-SG.js                    |      100 |      100 |      100 |      100 |                   |
  en-au.js                    |      100 |      100 |      100 |      100 |                   |
  en-ca.js                    |      100 |      100 |      100 |      100 |                   |
  en-gb.js                    |      100 |      100 |      100 |      100 |                   |
  en-ie.js                    |      100 |      100 |      100 |      100 |                   |
  en-il.js                    |      100 |      100 |      100 |      100 |                   |
  en-in.js                    |      100 |      100 |      100 |      100 |                   |
  en-nz.js                    |      100 |      100 |      100 |      100 |                   |
  en-tt.js                    |      100 |      100 |      100 |      100 |                   |
  en.js                       |      100 |      100 |      100 |      100 |                   |
  eo.js                       |      100 |      100 |      100 |      100 |                   |
  es-do.js                    |      100 |      100 |      100 |      100 |                   |
  es-pr.js                    |      100 |      100 |      100 |      100 |                   |
  es-us.js                    |      100 |      100 |      100 |      100 |                   |
  es.js                       |      100 |      100 |      100 |      100 |                   |
  et.js                       |      100 |      100 |      100 |      100 |                   |
  eu.js                       |      100 |      100 |      100 |      100 |                   |
  fa.js                       |      100 |      100 |      100 |      100 |                   |
  fi.js                       |      100 |      100 |      100 |      100 |                   |
  fo.js                       |      100 |      100 |      100 |      100 |                   |
  fr-ca.js                    |      100 |      100 |      100 |      100 |                   |
  fr-ch.js                    |      100 |      100 |      100 |      100 |                   |
  fr.js                       |      100 |      100 |      100 |      100 |                   |
  fy.js                       |      100 |      100 |      100 |      100 |                   |
  ga.js                       |      100 |      100 |      100 |      100 |                   |
  gd.js                       |      100 |      100 |      100 |      100 |                   |
  gl.js                       |      100 |      100 |      100 |      100 |                   |
  gom-latn.js                 |      100 |      100 |      100 |      100 |                   |
  gu.js                       |      100 |      100 |      100 |      100 |                   |
  he.js                       |      100 |      100 |      100 |      100 |                   |
  hi.js                       |      100 |      100 |      100 |      100 |                   |
  hr.js                       |      100 |      100 |      100 |      100 |                   |
  ht.js                       |      100 |      100 |      100 |      100 |                   |
  hu.js                       |      100 |      100 |      100 |      100 |                   |
  hy-am.js                    |      100 |      100 |      100 |      100 |                   |
  id.js                       |      100 |      100 |      100 |      100 |                   |
  is.js                       |      100 |      100 |      100 |      100 |                   |
  it-ch.js                    |      100 |      100 |      100 |      100 |                   |
  it.js                       |      100 |      100 |      100 |      100 |                   |
  ja.js                       |      100 |      100 |      100 |      100 |                   |
  jv.js                       |      100 |      100 |      100 |      100 |                   |
  ka.js                       |      100 |      100 |      100 |      100 |                   |
  kk.js                       |      100 |      100 |      100 |      100 |                   |
  km.js                       |      100 |      100 |      100 |      100 |                   |
  kn.js                       |      100 |      100 |      100 |      100 |                   |
  ko.js                       |      100 |      100 |      100 |      100 |                   |
  ku.js                       |      100 |      100 |      100 |      100 |                   |
  ky.js                       |      100 |      100 |      100 |      100 |                   |
  lb.js                       |      100 |      100 |      100 |      100 |                   |
  lo.js                       |      100 |      100 |      100 |      100 |                   |
  lt.js                       |      100 |      100 |      100 |      100 |                   |
  lv.js                       |      100 |      100 |      100 |      100 |                   |
  me.js                       |      100 |      100 |      100 |      100 |                   |
  mi.js                       |      100 |      100 |      100 |      100 |                   |
  mk.js                       |      100 |      100 |      100 |      100 |                   |
  ml.js                       |      100 |      100 |      100 |      100 |                   |
  mn.js                       |      100 |      100 |      100 |      100 |                   |
  mr.js                       |      100 |      100 |      100 |      100 |                   |
  ms-my.js                    |      100 |      100 |      100 |      100 |                   |
  ms.js                       |      100 |      100 |      100 |      100 |                   |
  mt.js                       |      100 |      100 |      100 |      100 |                   |
  my.js                       |      100 |      100 |      100 |      100 |                   |
  nb.js                       |      100 |      100 |      100 |      100 |                   |
  ne.js                       |      100 |      100 |      100 |      100 |                   |
  nl-be.js                    |      100 |      100 |      100 |      100 |                   |
  nl.js                       |      100 |      100 |      100 |      100 |                   |
  nn.js                       |      100 |      100 |      100 |      100 |                   |
  oc-lnc.js                   |      100 |      100 |      100 |      100 |                   |
  pa-in.js                    |      100 |      100 |      100 |      100 |                   |
  pl.js                       |      100 |      100 |      100 |      100 |                   |
  pt-br.js                    |      100 |      100 |      100 |      100 |                   |
  pt.js                       |      100 |      100 |      100 |      100 |                   |
  ro.js                       |      100 |      100 |      100 |      100 |                   |
  ru.js                       |      100 |      100 |      100 |      100 |                   |
  rw.js                       |      100 |      100 |      100 |      100 |                   |
  sd.js                       |      100 |      100 |      100 |      100 |                   |
  se.js                       |      100 |      100 |      100 |      100 |                   |
  si.js                       |      100 |      100 |      100 |      100 |                   |
  sk.js                       |      100 |      100 |      100 |      100 |                   |
  sl.js                       |      100 |      100 |      100 |      100 |                   |
  sq.js                       |      100 |      100 |      100 |      100 |                   |
  sr-cyrl.js                  |      100 |      100 |      100 |      100 |                   |
  sr.js                       |      100 |      100 |      100 |      100 |                   |
  ss.js                       |      100 |      100 |      100 |      100 |                   |
  sv.js                       |      100 |      100 |      100 |      100 |                   |
  sw.js                       |      100 |      100 |      100 |      100 |                   |
  ta.js                       |      100 |      100 |      100 |      100 |                   |
  te.js                       |      100 |      100 |      100 |      100 |                   |
  tet.js                      |      100 |      100 |      100 |      100 |                   |
  tg.js                       |      100 |      100 |      100 |      100 |                   |
  th.js                       |      100 |      100 |      100 |      100 |                   |
  tk.js                       |      100 |      100 |      100 |      100 |                   |
  tl-ph.js                    |      100 |      100 |      100 |      100 |                   |
  tlh.js                      |      100 |      100 |      100 |      100 |                   |
  tr.js                       |      100 |      100 |      100 |      100 |                   |
  tzl.js                      |      100 |      100 |      100 |      100 |                   |
  tzm-latn.js                 |      100 |      100 |      100 |      100 |                   |
  tzm.js                      |      100 |      100 |      100 |      100 |                   |
  ug-cn.js                    |      100 |      100 |      100 |      100 |                   |
  uk.js                       |      100 |      100 |      100 |      100 |                   |
  ur.js                       |      100 |      100 |      100 |      100 |                   |
  uz-latn.js                  |      100 |      100 |      100 |      100 |                   |
  uz.js                       |      100 |      100 |      100 |      100 |                   |
  vi.js                       |      100 |      100 |      100 |      100 |                   |
  x-pseudo.js                 |      100 |      100 |      100 |      100 |                   |
  yo.js                       |      100 |      100 |      100 |      100 |                   |
  zh-cn.js                    |      100 |      100 |      100 |      100 |                   |
  zh-hk.js                    |      100 |      100 |      100 |      100 |                   |
  zh-tw.js                    |      100 |      100 |      100 |      100 |                   |
  zh.js                       |      100 |      100 |      100 |      100 |                   |
 src/plugin/advancedFormat    |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/badMutable        |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/buddhistEra       |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/calendar          |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/customParseFormat |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/dayOfYear         |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/duration          |      100 |    96.23 |      100 |      100 |                   |
  index.js                    |      100 |    96.23 |      100 |      100 |            63,109 |
 src/plugin/isBetween         |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isLeapYear        |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isMoment          |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isSameOrAfter     |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isSameOrBefore    |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isToday           |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isTomorrow        |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isYesterday       |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isoWeek           |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/isoWeeksInYear    |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/localeData        |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/localizedFormat   |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/minMax            |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/objectSupport     |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/pluralGetSet      |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/quarterOfYear     |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/relativeTime      |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/timezone          |      100 |    92.86 |      100 |      100 |                   |
  index.js                    |      100 |    92.86 |      100 |      100 |                41 |
 src/plugin/toArray           |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/toObject          |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/updateLocale      |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/utc               |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/weekOfYear        |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/weekYear          |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
 src/plugin/weekday           |      100 |      100 |      100 |      100 |                   |
  index.js                    |      100 |      100 |      100 |      100 |                   |
------------------------------|----------|----------|----------|----------|-------------------|
Handlebars: Access has been denied to resolve the property "statements" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "branches" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "functions" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "lines" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details

Summary of all failing tests
 FAIL  test/plugin/timezone.test.js
  ● DST, a time that never existed Spring Forward › 2012-03-11 01:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T01:59:59-05:00"
    Received:
      "2012-03-11T00:59:59-05:00"

      122 |     const d = dayjs.tz(s, NY)
      123 |     const m = moment.tz(s, NY)
    > 124 |     expect(d.format()).toBe('2012-03-11T01:59:59-05:00')
      125 |     expect(d.format()).toBe(m.format())
      126 |     expect(d.utcOffset()).toBe(-300)
      127 |     expect(d.utcOffset()).toBe(m.utcOffset())
      
      at Object.<anonymous> (test/plugin/timezone.test.js:124:24)

  ● DST, a time that never existed Spring Forward › 2012-03-11 02:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T03:00:00-04:00"
    Received:
      "2012-03-11T02:00:00-04:00"

      133 |     const d = dayjs.tz(s, NY)
      134 |     const m = moment.tz(s, NY)
    > 135 |     expect(d.format()).toBe('2012-03-11T03:00:00-04:00')
      136 |     expect(d.format()).toBe(m.format())
      137 |     expect(d.valueOf()).toBe(m.valueOf())
      138 |     expect(d.valueOf()).toBe(1331449200000)
      
      at Object.<anonymous> (test/plugin/timezone.test.js:135:24)

  ● DST, a time that never existed Spring Forward › 2012-03-11 02:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T03:59:59-04:00"
    Received:
      "2012-03-11T02:59:59-04:00"

      144 |     const d = dayjs.tz(s, NY)
      145 |     const m = moment.tz(s, NY)
    > 146 |     expect(d.format()).toBe('2012-03-11T03:59:59-04:00')
      147 |     expect(d.format()).toBe(m.format())
      148 |     expect(d.valueOf()).toBe(m.valueOf())
      149 |     expect(d.valueOf()).toBe(1331452799000)
      
      at Object.<anonymous> (test/plugin/timezone.test.js:146:24)

  ● DST, a time that never existed Spring Forward › 2012-03-11 03:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-03-11T03:00:00-04:00"
    Received:
      "2012-03-11T02:00:00-04:00"

      155 |     const d = dayjs.tz(s, NY)
      156 |     const m = moment.tz(s, NY)
    > 157 |     expect(d.format()).toBe('2012-03-11T03:00:00-04:00')
      158 |     expect(d.format()).toBe(m.format())
      159 |     expect(d.valueOf()).toBe(m.valueOf())
      160 |     expect(d.valueOf()).toBe(1331449200000)
      
      at Object.<anonymous> (test/plugin/timezone.test.js:157:24)

  ● DST, a time that never existed Fall Back › 2012-11-04 00:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T00:59:59-04:00"
    Received:
      "2012-11-03T23:59:59-04:00"

      171 |     [dayjs, moment].forEach((_) => {
      172 |       const d = _.tz(s, NY)
    > 173 |       expect(d.format()).toBe('2012-11-04T00:59:59-04:00')
      174 |       expect(d.utcOffset()).toBe(-240)
      175 |       expect(d.valueOf()).toBe(1352005199000)
      176 |     })
      
      at forEach (test/plugin/timezone.test.js:173:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:171:21)

  ● DST, a time that never existed Fall Back › 2012-11-04 01:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T01:00:00-04:00"
    Received:
      "2012-11-04T00:00:00-04:00"

      180 |     [dayjs, moment].forEach((_) => {
      181 |       const d = _.tz(s, NY)
    > 182 |       expect(d.format()).toBe('2012-11-04T01:00:00-04:00')
      183 |       expect(d.utcOffset()).toBe(-240)
      184 |       expect(d.valueOf()).toBe(1352005200000)
      185 |     })
      
      at forEach (test/plugin/timezone.test.js:182:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:180:21)

  ● DST, a time that never existed Fall Back › 2012-11-04 01:59:59

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T01:59:59-04:00"
    Received:
      "2012-11-04T00:59:59-04:00"

      189 |     [dayjs, moment].forEach((_) => {
      190 |       const d = _.tz(s, NY)
    > 191 |       expect(d.format()).toBe('2012-11-04T01:59:59-04:00')
      192 |       expect(d.utcOffset()).toBe(-240)
      193 |       expect(d.valueOf()).toBe(1352008799000)
      194 |     })
      
      at forEach (test/plugin/timezone.test.js:191:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:189:21)

  ● DST, a time that never existed Fall Back › 2012-11-04 02:00:00

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2012-11-04T02:00:00-05:00"
    Received:
      "2012-11-04T01:00:00-05:00"

      198 |     [dayjs, moment].forEach((_) => {
      199 |       const d = _.tz(s, NY)
    > 200 |       expect(d.format()).toBe('2012-11-04T02:00:00-05:00')
      201 |       expect(d.utcOffset()).toBe(-300)
      202 |       expect(d.valueOf()).toBe(1352012400000)
      203 |     })
      
      at forEach (test/plugin/timezone.test.js:200:26)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (test/plugin/timezone.test.js:198:21)

 FAIL  test/plugin/utc-utcOffset.test.js
  ● change hours when changing the utc offset in UTC mode

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      5
    Received:
      4

      87 |   expect(d.hour()).toBe(6)
      88 |   expect(d.utcOffset(0).hour()).toBe(6)
    > 89 |   expect(d.utcOffset(-60).hour()).toBe(5)
      90 |   expect(d.utcOffset(60).hour()).toBe(7)
      91 |   expect(d.utcOffset(-30).format('HH:mm')).toBe('06:01')
      92 |   expect(d.utcOffset(30).format('HH:mm')).toBe('07:01')
      
      at Object.<anonymous> (test/plugin/utc-utcOffset.test.js:89:35)

  ● keep hours when adding month in offset mode

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      6
    Received:
      5

      111 |   const dm8 = dayjs('2000-01-30T06:31:00-08:00').utcOffset(-8)
      112 | 
    > 113 |   expect(d10.add(1, 'month').hour()).toBe(6)
      114 |   expect(dm8.add(1, 'month').hour()).toBe(6)
      115 | 
      116 |   expect(d10.add(-2, 'month').hour()).toBe(6)
      
      at Object.<anonymous> (test/plugin/utc-utcOffset.test.js:113:38)


Test Suites: 2 failed, 57 passed, 59 total
Tests:       10 failed, 554 passed, 564 total
Snapshots:   0 total
Time:        22.799s
Ran all test suites.
npm ERR! Test failed.  See above for more details.
@tukusejssirs
Copy link
Contributor Author

@iamkun, I’m sorry, I thought that #1053 was already merged. Sorry for opening this issue.

@iamkun
Copy link
Owner

iamkun commented Sep 17, 2020

sure

@iamkun iamkun closed this as completed Sep 17, 2020
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

No branches or pull requests

2 participants