笑话未定义

时间:2019-03-14 18:50:54

标签: reactjs typescript jestjs react-testing-library

我目前正在使用打字稿制作一个React应用,并且正在使用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;

0 个答案:

没有答案