vscode automatic type acquisition for jest

You have a few options in this case:

Add jest to your package.json:

"dependencies": {
  "jest": "^18.1.0"
}

This only works if you are working JavaScript and do not have a tsconfig.json.


Install @types/jest

$ npm install -D @types/jest

This should work for both JavaScript and TypeScript projects. However @types but may be disabled by a jsconfig.json/tsconfig.json: http://www.typescriptlang.org/docs/handbook/tsconfig-json.html


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

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

This will only work for JavaScript projects when automatic typings acquisition is enabled.

All of these should allow VSCode to pick up jest’s typings without an import or require

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)