不变冲突:在"Connect(IndexResult)"的上下文或道具中都找不到"store"。要么将根组件包装在 中,要么显式将"store"作为 prop 传递给 "Connect(IndexResult)"。
当我尝试使用mount时收到此错误
常量包装器 = mount();
创建此函数:
export const wrapIntoReduxProvider = testingContainerComponent => (
<Provider store={organizationStore({})}>
{testingContainerComponent}
</Provider>
);
并将您的组件包装在其中
const wrapper = mount(wrapIntoReduxProvider(<YourComponent />));