I reviewed the interactive guidelines, but leaves no explicit documentation for the enzyme .
This is how I tried to write my tests.
import {IntlProvider} from 'react-intl'; const intlProvider = new IntlProvider({locale: 'en'}, {}); const intl = intlProvider.getChildContext(); const customMessage = shallow(<CustomMessage />, { options: { context: intl } });
But I keep getting the error
Invariant violation: [React Intl] Could not find the required intl object. must exist in the pedigree of the component.
I looked through their repo and they seem to have done its job using 'react-addons-test-utils'.
Am I doing something wrong?
source share