DEV Community

Discussion on: Unit Testing with Typescript and Jest

Collapse
 
justincalleja profile image
Justin Calleja

Nice post thanks! While following along, I had to add this to tsconfig.json to get it to work (after installing @types/jest):

  "types": ["node", "jest"]

Otherwise, I'd get:

Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.