code:
class Foo extends React.PureCompo
Solution:
1: use the async/await syntax.
2: Use mount (no shallow).
3: await async componentLifecycle.
For ex:
test(' ',async () => { const wrapper = mount( ); await wrapper.instance().componentDidMount(); })