Jest setup
Unanswered
Sjoerd posted this in #help-forum
SjoerdOP
I try to setup Jest in my already existing project. I used this guide:
https://nextjs.org/docs/app/building-your-application/testing/jest
I added all packages with:
yarn add -D jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom
Then I follow the next step by running:
yarn create jest@latest
And I get this error in my terminal:
yarn create jest@latest
yarn create v1.22.5
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "create-jest@29.7.0" with binaries:
- create-jest
/bin/sh: /Users/gebruiker/.yarn/bin/create-jest@latest: No such file or directory
error Command failed.
Exit code: 127
Command: /Users/gebruiker/.yarn/bin/create-jest@latest
Arguments:
Directory: /Users/gebruiker/Desktop/paletti
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
Would really appreciate if someone can help!
https://nextjs.org/docs/app/building-your-application/testing/jest
I added all packages with:
yarn add -D jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom
Then I follow the next step by running:
yarn create jest@latest
And I get this error in my terminal:
yarn create jest@latest
yarn create v1.22.5
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "create-jest@29.7.0" with binaries:
- create-jest
/bin/sh: /Users/gebruiker/.yarn/bin/create-jest@latest: No such file or directory
error Command failed.
Exit code: 127
Command: /Users/gebruiker/.yarn/bin/create-jest@latest
Arguments:
Directory: /Users/gebruiker/Desktop/paletti
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
Would really appreciate if someone can help!