Add Autocomplete for Jest in VS Code

Published 2020-05-20


A man with hood

Photo by Amin Moshrefi on Unsplash

Problem Background

I am writing unit tests for my Node application using Jest. However, I encountered an issue which is the VsCode Intellisense (code autocomplete) is not working.

Referring to the documentation is pretty troublesome and not productive too.

So, how do I get my VSCode Intellisense for Jest?

Solution

The solution turned out seems to be pretty easy after read through the Github issue.

We just have to install the @types/jest as our development dependencies.

npm i -D @types/jest

Happy coding. 😃😃😃

References

  • Jest Community Github Issue