不知道为什么我在我的简单Main.test文件中收到此错误.
Main.js的构造函数
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的
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(
有没有办法模拟’路径名’?
最佳答案
原文链接:https://www.f2er.com/js/429182.html