jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.26k stars 508 forks source link

VScode unable to find type definitions for jest. #743

Closed ydennisy closed 4 years ago

ydennisy commented 4 years ago

Current Behavior

Everything is working as expected, but VSCode cannot find the type definitions for jest, I am pretty much using an unchanged init of the library:

image

I have tried adding the types manually to the package.json with no luck.

Expected behavior

No errors to be shown.

Suggested solution(s)

Additional context

Your environment

Software Version(s)
TSDX 0.13.2
TypeScript 3.9.5
Browser NA
npm/Yarn 1.6.0
Node 12
Operating System Mac
agilgur5 commented 4 years ago

Might be a regression from #672 since @types/jest was removed from the templates and added as a direct TSDX dependency (maybe that's why it was like that in the first place but there were no comments on it :confused: ).

But since you said you installed the types yourself and it still didn't work sounds like a possible duplicate of #696 .

I have tried adding the types manually to the package.json with no luck.

Did you npm install -D @types/jest? Or just added to package.json?

nikhilag commented 3 years ago

@agilgur5 I tried yarn add @types/jest --dev but it didn't work for me. I am still getting the following error in VSCode:-

Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try npm i --save-dev @types/jest or npm i --save-dev @types/mocha.ts(2582)

Can we reopen this issue because it seems anyone would encounter this during setup itself?

mserikov commented 1 year ago

@agilgur5 I tried yarn add @types/jest --dev but it didn't work for me. I am still getting the following error in VSCode:-

Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try npm i --save-dev @types/jest or npm i --save-dev @types/mocha.ts(2582)

Can we reopen this issue because it seems anyone would encounter this during setup itself?

+1