joetidee / enzyme-react-intl

A complimentary wrapper function for use with Enzyme, when testing React components that rely on react-intl
MIT License
45 stars 15 forks source link

ReactIntl Error - No locale data provided #9

Closed afsheenirani closed 6 years ago

afsheenirani commented 6 years ago

When testing my React components using enzyme and the enzyme-react-intl package, I get the below error. I'm a bit confused as to why I get this error, because there is already a default locale of 'en' set in the enzyme-react-intl package as seen here.

ERROR LOG: '[React Intl] Error formatting date. ReferenceError: No locale data has been provided for this object yet.'

I am using the mountWithIntl API to test my component as seen below: component = mountWithIntl(<CustomComponent propName={propValue} />);

Is there any additional setup required given before mounting the component?

joetidee commented 6 years ago

Did you manage to solve this issue?