javascript - TypeError: value.includes 不是使用挂载测试的函数
问题描述
我正在尝试使用mount
import React from 'react';
import { mount } from 'enzyme'
import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
describe('component', ()=>{
const middlewares = [thunk];
const mockStore = configureStore(middlewares);
const store = mockStore({data: [] });
const wrapper = mount(
<Provider store={store}>
<Component onClick={jest.fn()} shouldFetch={true} />
</Provider>
);`enter code here`
it('THEN should', ()=>{
})
})
但是当我执行测试时出现错误:
TypeError: value.includes is not a function
但是当我尝试shallow
一切都很好时
解决方案
推荐阅读
- python - RDF 库和 SPARQL 问题
- sql - 从 USB DRIVE .MDF .LDF 读取数据时出错
- jquery - Bootstrap 4.0.0 的 Jquery 兼容版本是什么
- python - 如何在python中连接这样的变量
- broadleaf-commerce - ProductOptionValueImpl 的类转换错误 - Broadleaf 商业
- c# - 当菜单打开时,Windows 标题栏的最小化、最大化和关闭按钮在单击时不起作用
- css - 反应模态动画模态关键帧
- eclipse-plugin - 更改新文件菜单项的顺序 Eclipse rcp
- sql - Max a Sum of a partition by
- oracle - Oracle 序列不同步/不匹配表