Monday, October 16, 2017

ts-jest Cannot find name 'test'




There are two ways to fix that. One, import 'jest' directly:




Another way is to put the jest type in tsconfig.json:



Happy Coding!

5 comments:

  1. Thank you, this was very helpful

    ReplyDelete
  2. for typescript, you need to include "import '@types/jest';"

    ReplyDelete
  3. Glad this article was at the top of my search results. Thanks a lot!

    ReplyDelete
  4. Glad this article was at the top of my search results. Thanks a lot!

    ReplyDelete