解:
1:使用异步/等待语法。
2:使用安装座(不浅)。
3:等待异步组件生命周期。
例如:
test(' ',async () => { const wrapper = mount( <Foo /> ); await wrapper.instance().componentDidMount(); })
解:
1:使用异步/等待语法。
2:使用安装座(不浅)。
3:等待异步组件生命周期。
例如:
test(' ',async () => { const wrapper = mount( <Foo /> ); await wrapper.instance().componentDidMount(); })