Vscode automatic type retrieval for jokes

I have vscode 1.9 and I want to have intellisense for jest tests. The problem is that describe, it, expectetc. Available around the world as a joke, and you do not need importthem in test files. Therefore, vscode will not show intellisense for them.

Is there any configuration for global bindings to automatically get the type?

+4
source share
1 answer

In this case, you have several options:

Add jestto your package.json:

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

This only works if you are working with JavaScript and don't have one tsconfig.json.


Set @types/jest

$ npm install @types/jest

JavaScript, TypeScript. @types, jsconfig.json/tsconfig.json: http://www.typescriptlang.org/docs/handbook/tsconfig-json.html


jsconfig.json , jest:

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

JavaScript, .

VSCode

+7

Source: https://habr.com/ru/post/1668732/


All Articles