Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 使用渲染的酶和笑话_Reactjs_React Router_Jestjs_Enzyme_React Router V4 - Fatal编程技术网

Reactjs 使用渲染的酶和笑话

Reactjs 使用渲染的酶和笑话,reactjs,react-router,jestjs,enzyme,react-router-v4,Reactjs,React Router,Jestjs,Enzyme,React Router V4,我在React和React路由器上有一个简单的应用程序: import React from "react"; import { Switch, Route } from "react-router-dom"; export const Home = () => ( <div className="Home">Home</div> ); export const Profile = () => ( <div className="Profil

我在React和React路由器上有一个简单的应用程序:

import React from "react";
import { Switch, Route } from "react-router-dom";

export const Home = () => (
  <div className="Home">Home</div>
);

export const Profile = () => (
  <div className="Profile">Profile</div>
);

const App = () => (
  <Switch>
    <Route exact path="/" component={Home}/>
    <Route path="/anotherRouteToProfile" component={Profile}/>
  </Switch>
);

export default App;
从“React”导入React;
从“react router dom”导入{Switch,Route};
export const Home=()=>(
家
);
导出常量配置文件=()=>(
轮廓
);
常量应用=()=>(
);
导出默认应用程序;
我想写这样的路由测试

describe('<App />', () => {
  it('on "/profile" render `Profile` container', () => {
    const wrapper = render(
      <MemoryRouter initialEntries={['/profile']}>
        <App/>
      </MemoryRouter>
    );

    expect(
      wrapper.is(Profile)
    ).toBe(true);
  });
});

描述(“

请显示测试中的配置文件,并检查配置文件是否正确导入我认为所有关于导入的内容都可以。imgur.com/a/Uun7U而不是使用。您是否可以尝试查找它并检查长度?为了确保一件事,请显示测试中的配置文件,并检查配置文件是否正确导入我想所有关于t导入是可以的。imgur.com/a/Uun7U而不是使用。你能试着找到它并检查长度吗?只是为了确定一件事