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
264 stars 124 forks source link

Run Don't working with pnpm + WSL 2 (Ubuntu) #255

Open henriqueholtz opened 2 years ago

henriqueholtz commented 2 years ago

The Run don't work with pnpm + WSL 2 (Ubuntu)

Repo that you can reproduce: https://github.com/SharebookBR/sharebook-frontend-next

(Please, let me know if you need more informations to reproduce.)

Details:

If I execute yarn install, all works well, but if I execute pnpm install I receive the error bellow:

image

Thanks.

firsttris commented 2 years ago

there are some extension settings for pnpm https://github.com/firsttris/vscode-jest-runner#extension-settings

have you checked them?

but no xp with WSL2

peterpoliwoda commented 2 years ago

Hi, I've got a similar problem with WSL2. I think what's happening is, the //wsl\$/Ubuntu/home/ path is not understood by the terminal as wsl itself doesn't know what the //wsl$ alias is (!).

A way to sort this out would be either to use a relative path or drop the initial //wsl$ passed in to the Terminal

Errors I'm getting:

 $  node "node_modules/jest/bin/jest.js" "//wsl\$/Ubuntu/home/peterpoliwoda/Develop/git/TEC/packages/theme-editor-app/src/pages/translations/hooks/__tests__/utils.spec.ts" -c "//wsl$/Ubuntu/home/peterpoliwoda/Develop/git/TEC/jest.config.js" -t "getParsedStandardTexts"
Error: Can't find a root directory while resolving a config file path.
Provided path to resolve: //wsl$/Ubuntu/home/peterpoliwoda/Develop/git/TEC/jest.config.js 
cwd: /home/peterpoliwoda/Develop/git/TEC
    at _default (/home/peterpoliwoda/Develop/git/TEC/node_modules/jest-config/build/resolveConfigPath.js:106:11)
    at readConfig (/home/peterpoliwoda/Develop/git/TEC/node_modules/jest-config/build/index.js:209:49)
    at readConfigs (/home/peterpoliwoda/Develop/git/TEC/node_modules/jest-config/build/index.js:406:32)
    at runCLI (/home/peterpoliwoda/Develop/git/TEC/node_modules/@jest/core/build/cli/index.js:231:29)
    at Object.run (/home/peterpoliwoda/Develop/git/TEC/node_modules/jest-cli/build/cli/index.js:163:62)
    at Object.<anonymous> (/home/peterpoliwoda/Develop/git/TEC/node_modules/jest-cli/bin/jest.js:16:27)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)

WSL WSL WSL... I realise it may be a slightly different issue but the idea of RUN not working is the same :)

henriqueholtz commented 2 years ago

@peterpoliwoda they are differents troubles, really. Because in my terminal don't use //wsl\$/Ubuntu/home..., but directly /home/.....

I don't can verify the suggestion from @firsttris still.

peterpoliwoda commented 2 years ago

How would you run the plugin locally if I was to add a commit to try to fix the issue for certain individuals like myself?

henriqueholtz commented 2 years ago

@firsttris I've insetigated a little, and I realized this difference:

image

image

About the extension settings, you have some appointment ? The projectPath looks ok for example.