Create-react-app: Visual Studio code intellisense support for jest

Created on 24 Aug 2017  路  5Comments  路  Source: facebook/create-react-app

The solution is simple, but it's ideal to be included into boilerplate.

Solution:
Create a jsconfig.json file in the root of your workspace to specifically include jest:

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

Most helpful comment

Wouldn't yarn add @types/jest --dev suffice?

All 5 comments

Nice, didn't know you could do this, I'd been adding @types/jest with npm install without saving to get intellisense :)

Wouldn't yarn add @types/jest --dev suffice?

Then it would make my git status messy as I don't want to commit the dependency it as it's on a regular JS project.

I think incluiding that file would add noise to all those who don't use Visual Studio Code. Maybe you could add this piece of information to the User Guide.

This "just works" for me, especially when having @types/jest in devDependencies.

I'm not sure adding a section just for VSCode with the OP suggestion is worthwhile since no other IDEs support it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wereHamster picture wereHamster  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

fson picture fson  路  3Comments

ap13p picture ap13p  路  3Comments