Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting debugging from vscode -jest navigation panel fails with error item orta.vscode-jest: [project] is not debuggable #1056

Open
gbraven-dev opened this issue Aug 18, 2023 · 6 comments

Comments

@gbraven-dev
Copy link

gbraven-dev commented Aug 18, 2023

Debugging can be initiated from the vscode debug panel using the vscode-jest launch configuration and can also be initiated from the inline markup in the test files but the extension's own navigation panel fails to initiate debugging with the error "item orta.vscode-jest: [project] is not debuggable". This error did not occur on this project when the extension was first installed.

Environment

  1. vscode-jest version: 6.0.1
  2. node -v: 18.17.1
  3. npm -v or yarn --version: 9.6.7
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): 29.6.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: Windows 11

Prerequisite

  • are you able to run jest test from the command line? [fill]
  • how do you run your tests from the command line? (for example: npm run test or node_modules/.bin/jest) [fill]

Steps to Reproduce

[fill]

Relevant Debug Info

[fill]

Expected Behavior

[fill]

Actual Behavior

[fill]


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...

@connectdotz
Copy link
Collaborator

Hmmm... if I understand your use case correctly, you were trying to debug from the TestExplorer's tree, right? This error indicated you were trying to debug from a workspace root, it seems, which should not be debuggable - only the test-file, test/describe blocks are debuggable.

Do you have a sample repo so we can take a closer took?

@gbraven-dev
Copy link
Author

I apologize but I do not have a repository I can share.

From the vscode testing explorer tree (panel labeled "Testing" that pops open when you click on the testing extension shortcut) at the top there are 3 exposed buttons: Run Tests, Debug Tests, Show Output.

Run Tests --> All of my tests are successfully run
Debug Tests --> Get error mentioned in issue report shown in Terminal

If I expand the tree and navigate to an individual test file or to an individual test in that file and click its debug button it works.

If I launch the debug configuration configured for Jest from the main debug panel it works.

If I click on the interactive button overlays displayed when I open a test file in the an editor debugging works.

Just that top level "Debug Tests" fails.

Clearly not a showstopper of any kind for me. Just thought I would report in case it needs fixing.

@connectdotz
Copy link
Collaborator

I see, thanks for bringing it to our attention. This is the intended behavior though, maybe the message can be improved.

To debug from the root item means to run all tests for otherwise a single test block debugging, i.e. not very efficient. Therefore we disabled the root/directory level debugging, to encourage the adoption of more efficient debug runs.

Dose that make sense?

@gbraven-dev
Copy link
Author

Understood. User could choose to run all tests in debug mode for an explicit reason...so maybe letting user determine efficiency is optimal. For current implementation would just say the button should probably be disabled for clarity and would find a way to keep the error message from being generated so it doesn't cause confusion. Although these are very low severity/priority.

@connectdotz
Copy link
Collaborator

That's true, we should either enable and support debug for all situations, or disable the button altogether.

@sailingKieler
Copy link

That's true, we should either enable and support debug for all situations, or disable the button altogether.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants