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

Can't debug multiple test files in VS Code using deno test #13152

Open
jaredkrinke opened this issue Dec 20, 2021 · 7 comments
Open

Can't debug multiple test files in VS Code using deno test #13152

jaredkrinke opened this issue Dec 20, 2021 · 7 comments
Assignees
Labels
bug Something isn't working inspector related to the inspector integration

Comments

@jaredkrinke
Copy link

On 1.17, when I debug deno test --inspect-brk in VS Code, I'm only able to hit breakpoints in the first test file it runs. E.g. if I have two test files and set breakpoints in both, I only hit breakpoints in the first file.

If I always explicitly specify the test file as an argument, then I'm able to debug my test successfully.

Here's a repository with a minimal setup to reproduce (including launch.json file):
https://github.com/jaredkrinke/repro-deno-debug-two-files

Deno version:

deno 1.17.0 (release, x86_64-pc-windows-msvc)
v8 9.7.106.15
typescript 4.5.2

Steps to reproduce

  1. Open in VS Code
  2. Put breakpoints on the console.log lines in both one.test.ts and two.test.ts
  3. Fit F5 to start debugging with the provided launch.json
  4. Hit the first breakpoint
  5. Hit F5 to continue to the next breakpoint

Expected

The next breakpoint should be hit.

Actual

Debug session ends.

Note: I always hit the same breakpoint, and it's in the file that comes first alphabetically, so I suspect Deno is enumerating the files and running them sequentially in separate contexts, but for whatever reason, I can only debug the first context.

Workaround

To debug a particular test, just add that test's file name to the arguments in launch.json.

@jaredkrinke jaredkrinke changed the title Can't debug across multiple test files in VS Code using deno test Can't debug multiple test files in VS Code using deno test Dec 20, 2021
@bartlomieju bartlomieju self-assigned this Dec 20, 2021
@bartlomieju bartlomieju added the inspector related to the inspector integration label Dec 20, 2021
@stale
Copy link

stale bot commented Feb 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 19, 2022
@jaredkrinke
Copy link
Author

FYI: This still happens on Deno 1.19.0.

@stale
Copy link

stale bot commented Apr 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 21, 2022
@jaredkrinke
Copy link
Author

Just to avoid this bug getting closed automatically because it's stale, I'll note that this still happens on Deno 1.21.0.

@bartlomieju
Copy link
Member

bartlomieju commented Nov 28, 2022

FYI I'm investigated this issue and had a talk with @cjihrig to discuss how Node.js handles this; additionally I'll talk with VSCode team to discuss how to improve this behavior. Will act on this soon.

@jespertheend
Copy link
Contributor

I'm running into some wonky behaviour too, I think it might be the same issue. Though in my case the process just exits without even reporting any test results. Not sure why I'm only running into this now because I'm pretty sure I've used breakpoints in multiple files before.

@raigorx
Copy link

raigorx commented Jul 18, 2023

No being able to debug in a developer environment is catastrophic I have the same issue deno 1.35.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working inspector related to the inspector integration
Projects
None yet
Development

No branches or pull requests

5 participants