-
I am starting a new project at work and I am interested in trying out Typescript and eventually I will want to manage multiple packages so Yarn workspaces are why I started looking into Yarn. When getting started I liked the Plug'n'Play feature and would love to use it but I am running into the following issue. When I use the create-react-app typescript template it creates a simple test using jest-dom. However, it looks like something goes wrong with VSCode resolving correct types from jest-dom when using PnP. The tests when run via
If I switch the nodeLinker to This may not be a direct issue with yarn, it lies somewhere in the VSCode/Typescript/jest-dom/yarn-pnp landscape but I have no idea where to go from here to figure out where the issue is. Though since I am certain that yarn PnP is at least partially responsible I have come here. I tried a lot of the information contained in testing-library/jest-dom#123 but that looks like that was an issue with Typescript itself and is now resolved and you can see this is true because Steps to Reproduceyarn create react-app demo-app --template typescript
cd demo-app
yarn set version berry
# comment out the nodeLinker line in .yarnrc.yml
yarn install
yarn dlx @yarnpkg/sdks vscode
code .
# open up src/App.test.tsx |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The |
Beta Was this translation helpful? Give feedback.
The
create-react-app
template is missing a dependency on@types/testing-library__jest-dom