VS Code not recognizing Jest, underlining with Intellisense
I'm using VS Code in a Typescript project that uses Jest for testing. For some reason, VS Code thinks that the Jest globals are not available:
I have the Jest typedefs installed in my dev dependencies.
"devDependencies": {
// ...truncated
"@types/jest": "^20",
"jest": "^20.0.4",
"ts-jest": "^20.0.7",
"ts-node": "^5.0.0",
"typescript": "~2.4.0"
}
Correct answer here is that typescript requires type declarations for jest before jest global objects are visible for intellisense.
Add this triple-slash directive to beginning of your test file:
/// <reference types="jest" />