jest types are not recognized when in subfolder
See original GitHub issueEnvironment
-
node -v
: 10.15.3 -
npm -v
: 6.13.4 -
npm ls jest
: 25.1.0 -
your vscode-jest settings if customized: “jest.pathToJest”: “frontend/node_modules/.bin/jest”, “jest.pathToConfig”: “frontend/jest.config.js”,
-
Operating system: MacOS Catalina
Prerequisite
- are you able to run jest test from command line? yes
- how do you run your tests from command line? yarn test
Relevant Debug Info
so i have a project splitted up in frontend and backend folder the frontend is a typescript with parcel to compile it to js and jest for testing. nothing fancy. the node_modules are also in the frontend folder
The Jest Runner works fine.
but when i open the test.file i get this error “Cannot find name ‘test’. Do you need to install type definitions for a test runner? Try npm i @types/jest
or npm i @types/mocha
.ts(2582)” when i hover over “test” or “expect”
i installed the types. the file is colored red in the filetree.
i create a example repo (https://github.com/maxkarkowski/jest-vscode-test) with the vscode settings folder visible in it
Expected Behavior
vscode should find the types even if they are in a subfodler
Actual Behavior
test files are marked
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:5
Top GitHub Comments
Facing the same issue. Unit tests itself are working but intellisense isn’t.
Any suggestions?
Since this is not related to the extension, I will convert it to a discussion instead.