小编Jac*_*ace的帖子

玩笑没有定义

我目前正在用打字稿制作一个反应应用程序,我正在使用 react-testing-library 进行测试。该应用程序崩溃ReferenceError: jest is not defined。不过我所有的测试都通过了。

以前,一切正常。唯一改变的是我重新组织了一些文件。

代码:

import { FormProps } from "../containers";

const onChange = jest.fn(); // The problem
const history: any = jest.fn();
const location: any = jest.fn();
const match: any = jest.fn();

const TestProps: FormProps = {
  onChange,
  history,
  location,
  match,
};

export default TestProps;
Run Code Online (Sandbox Code Playgroud)

typescript reactjs jestjs react-testing-library

5
推荐指数
1
解决办法
4238
查看次数