Testing react-intl components with enzyme
I've posted an answer to a similar question:
Injecting react-intl object into mounted Enzyme components for testing
You would be able to import { shallowWithIntl } from 'intl-helper'
and then use shallowWithIntl()
instead of Enzyme's shallow()
.
I got it working by using
const customMessage = shallow(<CustomMessage />, { context: intl });
instead.