【发布时间】:2018-10-22 16:14:15
【问题描述】:
我收到错误:Invariant Violation: could not find "client" in the context of Query or as passed props。将根组件包裹在
中然后我在测试时使用 prop 客户端将组件包装在 apollo 提供程序中。
TypeError: this.client.watchQuery is not a function
732 |
733 | it('should close the overlay when the close button is clicked', () => {
> 734 | const mandateBatchWrapper = mount(
735 | <ApolloProvider client={clientForApollo}>
736 | <MandateBatch
737 | data={data}
【问题讨论】:
-
你最终解决了这个问题吗?