vscode-jest-runner
vscode-jest-runner copied to clipboard
Usage Error: Couldn't find a script named "jest"
I'm in a Yarn2 PnP monorepo, where jest
is installed in some of the modules' package.json
but not at the root package.json
. I tried running a test which was correctly highlighted by CodeLens but I received the following message in the terminal:
Usage Error: Couldn't find a script named "jest".
Repo structure is like this:
package.json (containing workspaces definition)
module1
package.json (containing own module dependencies)
tsconfig.json
jest.config.ts
module2
package.json (containing own module dependencies)
tsconfig.json
jest.config.js
module2 is using a different build system than module1 so I cannot have a common jest.config for the two
Have you checked the add-on settings options for PNP?
Regards Tristan
Simon Sotak @.***> schrieb am Mi., 12. Jan. 2022, 11:31:
I'm in a Yarn2 PnP monorepo, where jest is installed in some of the workspaces' package.json but not at the root package.json. I tried running a test which was correctly highlighted by CodeLens but I received the following message in the terminal:
Usage Error: Couldn't find a script named "jest".
— Reply to this email directly, view it on GitHub https://github.com/firsttris/vscode-jest-runner/issues/230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANBJTDRKAS5XNUBLKGEKSLUVVRCTANCNFSM5LYXOEPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
@firsttris Yes, it's enabled:

I think problem here is that you have no jest
in your root package.json
, though even if you add it there this might still not work correctly since it will try to load jest
config from root as well. Perhaps this plugin needs proper support for yarn workspaces, to work with monorepos.
check 0.4.48 and report if this issue still persists.