Skip to content

Add @types/jest to fix VSCode intellisense

Paul Slaughter requested to merge ps-fix-jest-vscode into master

What does this MR do and why?

This MR readds @types/jest to devDependencies, which seems to be necessary for VSCode to figure out what to do with jest globals 🤷

This was removed while in the MR to Update Jest 26 -> 27.

Screenshots or screen recordings

Before After
Screen_Shot_2022-08-14_at_8.19.47_PM Screen_Shot_2022-08-14_at_8.20.08_PM

How to set up and validate locally

Assuming you have VSCode locally, you can try inserting any of the Jest globals (e.g. jest, expect, it) with or without this change. Notice that with @types/jest, the VSCode intellisense recognizes these globals.

If you make a change to package.json and run yarn, you might need to also run the VSCode command Restart TS Server for the running TypeScript server to pick up the changes:

Screen_Shot_2022-08-14_at_8.22.15_PM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Paul Slaughter

Merge request reports