Describe the bug
I am using dayjs on my project and everything works fine, both locally and on prod, so there are no actual functional problems. However, when I run my tests (I am using @testing-library/react), I keep getting the following console.warn every time I test a component that uses dayjs:
Your locale has not been found.
Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale
Or you forget to import the locale with `require('dayjs/locale/{localeUsed}')`
fallback on English locale
I am also using i18next, and my project uses fr and en locales. Is there any config that I am missing for dayjs?
For instance, here is my TimePicker component and its TimePicker.spec test file that I am getting warnings from:
Describe the bug I am using dayjs on my project and everything works fine, both locally and on prod, so there are no actual functional problems. However, when I run my tests (I am using
@testing-library/react
), I keep getting the followingconsole.warn
every time I test a component that uses dayjs:I am also using
i18next
, and my project usesfr
anden
locales. Is there any config that I am missing fordayjs
?For instance, here is my
TimePicker
component and itsTimePicker.spec
test file that I am getting warnings from:TimePicker.tsx
TimePicker.spec.tsx
Expected behaviour No console warnings when using
@testing-library/react
.Information