jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.84k stars 295 forks source link

Right click on gutter icon only reruns test on Mac; no debug option anywhere #1007

Closed jtlapp closed 1 year ago

jtlapp commented 1 year ago

Environment

  1. vscode-jest version: [5.2.3]
  2. node -v: [v18.14.0]
  3. npm -v or yarn --version: [pnpm 7.26.3]
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): [jest 29.4.2]
  5. your vscode-jest settings if customized:
    • jest.jestCommandLine? [fill]
    • jest.autoRun? [fill]
    • anything else that you think might be relevant? [fill]
  6. Operating system: [Mac 12.3.1]

Prerequisite

Steps to Reproduce

On a Mac:

  1. Open a file with test.
  2. Ctrl-Click on the play icon in the gutter. It runs the test, same as just clicking on the icon. (Ctrl-click is equivalent to right click on Windows.) Hovering over the icon yields, "Click to run tests, right click for more options", so it's telling me I should be able to right-click.
  3. Ctrl-click on the play icon in the test pane. I get the following, with no debug option:

Screen Shot 2023-02-10 at 10 22 11

Expected Behavior

Ctrl-click on the gutter icon should pop up a menu. (And that menu should have a debug option.)

Ctrl-click on a play icon in the sidebar should pop up a menu with a debug option.

connectdotz commented 1 year ago

On test explorer tree view, the debug is only available for the test files/blocks, not for the folder or workspace. On editor gutter, the right click should bring up a context menu, similar to your screenshot above. If you did not see the context menu then the "right-click" is not working... On the gutter context menu, the "debug" itetm should always be available.

jtlapp commented 1 year ago

Gotcha. Then the explorer tree is working as expected, and the gutter context menu is not. I get no gutter context menu. Whatever kind of click I do, it reruns the test. Thanks!

connectdotz commented 1 year ago

Opening up the gutter context menu is controlled by vscode; not sure what we could have done to disable that... I can't reproduce what you are seeing... do you have a sample repo?

jtlapp commented 1 year ago

I have this problem in every repo I try, whether mine or not. If the problem is on my end, it has to do with the VSCode configuration, conflicting extensions, environment variables, or globally installed commands.

connectdotz commented 1 year ago

I think you are right, it seems to be something specific to your settings. If it is a common issue with his extension, I would expect many more people to complain about it, as the gutter context menu is where most test controls are. 🤔

jtlapp commented 1 year ago

I solved the problem. I can Ctrl-click to emulate right-clicking for everything but this extension. I can even Ctrl-click elsewhere within VSCode to get pop-up menus. But I'm using an Apple trackpad, and for some unknown reason, this particular extension requires me to perform a "secondary click" gesture to emulate Ctrl-clicking. My secondary gesture is currently configured to be two fingers clicking at once, and that pops up the menu.

It seems that this extension is receiving "right clicks" differently than most apps, but I do have a solution, so I'll close this.