不知道为什么我在我的简单Main.test文件中收到此错误.
Main.js的构造函数
@H_502_10@export class Main extends Component { constructor(props) { super(props); this.state = { location: splitString(props.location.pathname,'/dashboard/') } if (R.isEmpty(props.view)) { isViewServices(this.state.location) ? this.props.gotoServicesView() : this.props.gotoUsersView() } }
Main.test的
@H_502_10@import React from 'react' import * as enzyme from 'enzyme' import toJson from 'enzyme-to-json' import { Main } from './Main' import Sidebar from '../../components/Common/sidebar' const main = enzyme.shallow(
有没有办法模拟’路径名’?
最佳答案