VSCode Intellisense is not suggesting available methods in JEST #686
Replies: 31 comments 5 replies
-
I'm facing the same problem. Testing works fine, but methods aren't suggested. |
Beta Was this translation helpful? Give feedback.
-
same for me as well. |
Beta Was this translation helpful? Give feedback.
-
I'm having the same problem. I've tried installing @types/jest with |
Beta Was this translation helpful? Give feedback.
-
I found that I need to restart vscode after installing @types/jest if vscode was open during installation. Can anyone confirm if that is expected? |
Beta Was this translation helpful? Give feedback.
-
create after saving reload vscode. |
Beta Was this translation helpful? Give feedback.
-
For some reason this solution doesn't work for me. Interesting is that I found a post from Nicholas Zakas post with the solution you are proposing. I'm wondering if I need to tell vscode about |
Beta Was this translation helpful? Give feedback.
-
mine only works after i install node v10.15.0
|
Beta Was this translation helpful? Give feedback.
-
None of the provided solutions works for me. Guess what else can I try |
Beta Was this translation helpful? Give feedback.
-
Try to create a new user in your computer with a fresh installation of vscode and do |
Beta Was this translation helpful? Give feedback.
-
Install |
Beta Was this translation helpful? Give feedback.
-
Thanks, Guys, as mentioned above just the below in jsconfig.json works for me.
|
Beta Was this translation helpful? Give feedback.
-
install local and global types, works fine |
Beta Was this translation helpful? Give feedback.
-
Including the test folder in tsconfig fixed it for me.
|
Beta Was this translation helpful? Give feedback.
-
This worked for me too. I have the orta.vscode-jest extension installed and am running a react 16 project with |
Beta Was this translation helpful? Give feedback.
-
Only problem is that it then compiles the code test project folder. Still not a great solution... |
Beta Was this translation helpful? Give feedback.
-
Yup, yesterday it wasn't working. I closed and went to sleep and it is working now. I did a lot of window reload yesterday but didn't work either. |
Beta Was this translation helpful? Give feedback.
-
before read this issue i thought need an extension like jest -published by orta- . but after installing @types/jest and reload vs-code the methods suggested successfully by vs-code :) |
Beta Was this translation helpful? Give feedback.
-
P.S Doing both steps worked for me, and the last one 🙂
|
Beta Was this translation helpful? Give feedback.
-
In my vscode this solution works very well. |
Beta Was this translation helpful? Give feedback.
-
Dude, thank you so much |
Beta Was this translation helpful? Give feedback.
-
my case was an outdated version of |
Beta Was this translation helpful? Give feedback.
-
My case was opening VSCode at the root of our repo, rather than the src folder which contained our jest.config.js and tsconfig.json files. When I opened the src folder as a VSCode Project, everything worked as expected. |
Beta Was this translation helpful? Give feedback.
-
@dil-dbakker Thank you! This was exactly my problem. I tried about a thousand complicated config options people were proposing but I was just one directory "too high" opening a parent directory in VSCode. Running |
Beta Was this translation helpful? Give feedback.
-
This suggestion worked for me very well. Thanks for the feedback @Waserman |
Beta Was this translation helpful? Give feedback.
-
great thread to help people resolving similar issues. But since this issue is really not related to this extension, I will close it. |
Beta Was this translation helpful? Give feedback.
-
I was experiencing this same sort of problem where intellisense would not show the available jest methods despite doing what almost every thread on the topic suggests I was able to resolve it but I don't know why this works. remove My resulting config looks like this (minus work specific stuff) The packages I have installed relevant to testing I don't totally know why this works but it's worth a shot if you were stuck like me |
Beta Was this translation helpful? Give feedback.
-
Another workaround is to use explicit import: "However, if you prefer explicit imports, you can do import {describe, expect, test} from '@jest/globals'."as documented here https://jestjs.io/docs/api PS: I was not able to solve the problem with other suggest methods. |
Beta Was this translation helpful? Give feedback.
-
If none of the above solutions work for you, you may be running into a similar issue as I was. The problem I was encountering was that type checking worked fine for all the I was running a fairly old version of jest ( I didn't initially notice the version mismatch between I decided after exhausting all other options to align the version of |
Beta Was this translation helpful? Give feedback.
-
Try to delete |
Beta Was this translation helpful? Give feedback.
-
This |
Beta Was this translation helpful? Give feedback.
-
Environment
node -v
: v.9.2.0npm -v
: 5.5.1npm ls jest
ornpm ls react-scripts
(if you haven’t ejected):npm ls jest
+-- [email protected]
-- [email protected]
-- [email protected]your vscode-jest settings if customized:
Operating system: Windows_NT x64 10.0.17134
Prerequisite
Steps to Reproduce:
Create a new react app using
1 .npx create-react-app my-app
2. npm install --save-dev jest
3. Opened the project in VSCode.
Expected Behavior
I expect VS Code intellisense would assist me with available methods from JEST.
Actual Behavior
VS Code is not suggesting me any method suggestions for JEST test cases.
Beta Was this translation helpful? Give feedback.
All reactions