dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

Looks like some tests are broken

Open luizfchaves opened this issue 3 years ago • 2 comments

Describe the bug I downloaded the repo and ran the commands: npm ci npm run test

then i got 2 tests failed:

Summary of all failing tests
 FAIL  test/plugin/localizedFormat.test.js
  ● Should not interpolate characters inside square brackets

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "1970 l 1970"
    Received:
      "1969 l 1969"

      29 |
      30 |   expect(actualDate.format('[l]')).toBe('l')
    > 31 |   expect(actualDate.format('YYYY [l] YYYY')).toBe('1970 l 1970')
      32 |   expect(actualDate.format('l [l] l')).toBe('1/1/1970 l 1/1/1970')
      33 |   expect(actualDate.format('[L LL LLL LLLL]')).toBe(expectedDate.format('[L LL LLL LLLL]'))
      34 |
      
      at Object.<anonymous> (test/plugin/localizedFormat.test.js:31:46)

 FAIL  test/plugin/dayOfYear.test.js
  ● DayOfYear set

    expect(received).toBe(expected) // Object.is equality
    
    Expected value to be:
      "2015-01-04T00:00:00.000Z"
    Received:
      "2014-01-05T00:00:00.000Z"

      31 |   expect(dayjs('2015-01-01T00:00:00.000Z')
      32 |     .dayOfYear(4)
    > 33 |     .toISOString()).toBe('2015-01-04T00:00:00.000Z')
      34 |
      35 |   expect(dayjs('2015-01-01T00:00:00.000Z')
      36 |     .dayOfYear(32)
      
      at Object.<anonymous> (test/plugin/dayOfYear.test.js:33:21)


Test Suites: 2 failed, 75 passed, 77 total
Tests:       2 failed, 702 passed, 704 total
Snapshots:   0 total
Time:        3.618s

Expected behavior All tests passing

Information

  • Day.js Version 1.11.3
  • OS: WSL: UBUNTU-20.04
  • Time zone: GMT-03:00 GMT( Greenwich Mean Time )

luizfchaves avatar Jun 16 '22 19:06 luizfchaves

I used my windows wsl to run the tests and it showed no errors. I only get a deprecation warning from node.

My configuration is: Ubuntu 20.04.4 LTS node v16.15.1 dayjs 1.11.3 (branch master of repository) Time zone CET (GMT+02:00)

So the only point that comes to my mind is your node version; which version do you use?

BePo65 avatar Jun 26 '22 08:06 BePo65

It was already discussed in #1260 and it seems to be fixed in 1.11.2

Bykiev avatar Jun 30 '22 16:06 Bykiev