Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
ethanneff opened this issue · comments
Relevant code or config:
yarn tsc
What you did:
upgrade from 5.17.0 to 6.0.1
What happened:
Got an error
Reproduction:
Got the following error
Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
Problem description:
Error when updating @testing-library/jest-dom
Suggested solution:
Not to error
Adding the following to jest.setup.ts
did not work
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/jest-globals';
The following worked
yarn add -D @types/jest
Glad you got it working.