我目前正在使用 typescript 制作一个 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;