Tests running stangely on my machine
0atman opened this issue · 2 comments
0atman commented
Creating this issue to track my investigation.
I think this is likely a problem with my machine, but we'll see.
The problem is this test fails with a en-US-like string:
expect(received).toContain(expected) // indexOf
Expected substring: "Monday, February 24, 2020"
Received string: "Monday, 24 February 2020"
280 | const input = '2020-02-24T16:32:03.000Z';
281 | const output = formatDate(new Date(input),{ weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
> 282 | expect(output).toContain('Monday, February 24, 2020');
But my machine seems to be recognised by node as en-GB:
λ node
> new Intl.DateTimeFormat().resolvedOptions().locale
'en-GB'
Ways to fix this:
- Remove the test
- fix @0atman's odd locale
0atman commented
FAIL src/components/performance/controllers.test.tsx
● formatDate › should output date string based on provided format options from given timestamp
expect(received).toContain(expected) // indexOf
Expected substring: "Monday, February 24, 2020"
Received string: "Monday, 24 February 2020"
PROGRESS, I updated my node to latest and only the locale error remains
0atman commented