在Redux连接的组件上运行测试用例时的嘲笑内存泄漏
When I run my jest tests, I got the following error , this particularly happens with the redux connected components and forwardRef:true is one parameters of the connect wrapper component
How can I fix my jest configuration to prevent this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于每个测试,您可能需要在挂钩后进行一些清理。您还可以考虑为Redux Store提供模拟是否合适,以便您将组件测试与还原测试隔离。
You may need to do some cleanup in the after hook for each test. You might also consider whether its appropriate to provide a mock for the redux store, so that you are isolating the component tests from the reducer tests.