Virtual Studio Code and Jest IntelliSense Headaches Cured

Chris Washington
1 min readJan 8, 2020

--

My favorite IDE to work in whether free or paid is Virtual Studio Code. My favorite unit testing framework is Jest.

There are many reasons for this, however one of the biggest headaches is getting VS Code IntelliSense to work with Jest (for one reason or another it isn’t supported out of the box).

Solution

To get VS Code IntelliSense to work with Jest, we need to tell the IDE to look for a community maintained type in the VS Code jsconfig.json file. To do this, create a file at the root of your node project named jsconfig.json and add the following code:

{
"typeAcquisition": {
"include": [ "jest" ]
}
}

Now the IDE knows about the type and will use it for IntelliSense in your project and should make coding your unit tests a little faster.

--

--

Chris Washington
Chris Washington

Written by Chris Washington

Chris is a Sr. Lead Software Engineer at Capital One just doing what he loves: creating epic things, and writing about them.

Responses (2)