firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

Debug not working #208

Closed Code-Quake closed 3 years ago

Code-Quake commented 3 years ago

When I try to debug a test with yarn pnp enabled I just get an error that says: Cannot find module 'C:\Projects\xxx.yarn\releases\yarn-*.cjs'

It is there and named yarn-3.0.1.cjs

Code-Quake commented 3 years ago

I fixed it by adding this in jestRunner.ts

if (this.config.isYarnPnpSupportEnabled) {
  config.args = ['jest'];
  if(!this.config.jestBinPath)
    config.program = '.yarn/releases/yarn-*.*js';
}

I can do a PR if you like.

firsttris commented 3 years ago

i think there is already a fix commited but no new version released. https://github.com/firsttris/vscode-jest-runner/commit/aeaaebe950f2615ad00239f5a3b885bcc23e6b1c

please re-open if the issue still persists in 0.45 and above