react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Cannot read property 'locales' of undefined

Open ramirobg94 opened this issue 2 years ago • 1 comments

Please make our job easier by filling this template out to completion. If you're requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

Im writing tests with jest and I having this error

Expected Behavior

Add a mock should be enough

Observed Behavior

Captura de Pantalla 2022-04-20 a las 14 35 25
 FAIL  src/state/rtc/sagas/index.test.js
  ● Test suite failed to run

    TypeError: Cannot read property 'locales' of undefined

      22 | Object.keys(resources || []).forEach((locale) => {
      23 |   console.log('local', locale, LocaleConfig)
    > 24 |   LocaleConfig.locales[locale] = {
         |                ^
      25 |     monthNames: moment
      26 |       .localeData(locale)
      27 |       .months()

      at forEach (src/i18n/index.js:24:16)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (src/i18n/index.js:22:30)
      at Object.<anonymous> (src/state/preferences/sagas.js:8:1)

  console.log
    local en undefined

      at forEach (src/i18n/index.js:23:11)
          at Array.forEach (<anonymous>)

Environment

Please run these commands in the project folder and fill in their results:

Also specify:

Runing test in Mac

ramirobg94 avatar Apr 20 '22 12:04 ramirobg94

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 21 '22 06:07 stale[bot]

I'm getting this error too. How did you fix it?

kelokchan avatar May 22 '23 12:05 kelokchan