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 Jest" suddenly stopped working #160

Closed yolpsoftware closed 3 years ago

yolpsoftware commented 3 years ago

My Jest Runner extension was running fine for months, but today it suddenly stopped. The "Debug Jest" and "Run Jest" items are still present in the context menu, but when I run them in my test file, nothing happens. There is no output in the console, and no debug session gets started.

This happens on all my test files, which all end in *.test.ts. However, I just noted that on the other files, those that do not contain any tests, the Jest Runner runs perfectly. I click on Debug Jest, and it starts a debug session which tries to run the tests of that file - except that file does not contain any test.

I tried uninstalling and reinstalling the extension, restarting VSCode. No luck, nothing happens on Debug Jest or Run Jest.

Version: 0.4.34

UPDATE: Oh wow, I just noticed that in version 0.4.33, everything still works! As soon as I install 0.4.34, the tests don't run anymore.

RandomEngy commented 3 years ago

0.4.33 works for me. 0.4.34, the "Run Jest File" option is missing and neither the "Debug Jest" or "Run Jest" options do anything when clicked.

The "Run" and "Debug" inline options are also missing in 0.4.34.

joanna-liana commented 3 years ago

In my case, "Debug" and "Run" options work fine in 0.4.34 (both on Mac and Windows) but "Run Jest File" is missing. Downgrade to 0.4.33 fixes that indeed.

firsttris commented 3 years ago

@joanna-liana i removed the option from context-menu, because i didn't want to spam it with to many options, its still available in the command palette (strg + shift + p)

maybe i have time at the WE to fix that other issue.

RandomEngy commented 3 years ago

I used the "Run Jest File" context menu option quite a bit, and will miss it. Now I need to come up with a keyboard shortcut that doesn't interfere with anything else.

Thanks for taking a look at the other issue.

LinqLover commented 3 years ago

I used the "Run Jest File" context menu option quite a bit, and will miss it. Now I need to come up with a keyboard shortcut that doesn't interfere with anything else.

Ctrl + Shift + P , Run j , Enter is quite convenient for me. :-)

RandomEngy commented 3 years ago

Ctrl+Shift+P I think you mean. Ctrl+P is find file. I think 2 clicks is easier than 9 keys, so I'd need to find some other combo.

LinqLover commented 3 years ago

Yeah of course. Or just use F1 instead. I think it depends on whether you are keyboard or mouse guy. Personally, I often prefer the keyboard because it requires less visual feedback (blind typing) ...

willbt commented 3 years ago

I have the same issue. Any usage of <jest.Mock> prevents the inline Run/Debug options from showing. I downgraded to 0.4.33 and it works

andreabisello commented 3 years ago

in my case it don't work even downgrading to previous version . the "run" and "debug" buttons make nothing.

image

firsttris commented 3 years ago

please check if this is working again with v0.4.35, if not please re-open this issue,

if you have another issue which is not connected to this topic, please open a new issue.

thx for your feedback guys, pull-requests are always welcome,

best regards Tristan

LinqLover commented 3 years ago

After installing v0.4.35, it seems to keep working on my end. Awesome, thanks for getting this working again!

yolpsoftware commented 3 years ago

Can confirm, v0.4.35 works again. Thank you!

Lutier2017 commented 3 years ago

Hi, I my case "Jest Runner" stopped to work, and I have installed version 0.4.35 I am using "Git Bash"

Now the command to run the test is something like: $ node "c:/project/node_modules/jest/bin/jest.js" "c://project//test//testFile/.spec/.js" -t "This test"

Instead of: $ node "c:/project/node_modules/jest/bin/jest.js" "c:/project/test/testFile.spec.js" -t "This test"

I have found that If I manually write the above command in the terminal, jest is working properly.

I appreciate some help.

yolpsoftware commented 3 years ago

Uh, v0.4.39 does not work, again. Rollback to v0.4.33.

firsttris commented 3 years ago

I'm sorry that it broke for your setup again.

If you would be a bit more precise what exacly is not working for you in 39 we could track down the change and revert it.

Why did you jump back to 33 when version 35 was working fine for you?

Lutier2017 commented 3 years ago

As yolpsoftware indicated, I rolled back to "Jest Runner" v0,4.34 and everything is working fine again.

firsttris commented 3 years ago

im happy that a downgrade worked for you, but as i said, its hard to reproduce an issue, if i don't know what your issue is.

i double checked run & debug on linux with bash and on windows with powershell, but could not reproduce any issue.

in the meantime i released v.0.4.43 which includes a new version of the parser (jest-editor-support) which also fixed some issues.

if you still have issues, please open a new issue, since i will not continue to reply here.

yolpsoftware commented 3 years ago

v0.4.44 works again, thanks.