我正在其容器中使用withTracker测试组件.
发生错误:
TypeError: (0 , _reactMeteorData.withTracker) is not a function.
我想我还没有嘲笑react-meteor-data / withTracker.有人能告诉我如何嘲笑它吗?或者有什么解决方案吗?
我设法使用以下方法将测试从createContainer升级到withTracker:
在你的模拟react-meteor-data.js文件中.
const createContainer = jest.fn((options = {}, component) => component );
const withTracker = jest.fn(Op => jest.fn(C => createContainer(Op, C)));
然后导出withTracker而不是createContainer.