-
-
Notifications
You must be signed in to change notification settings - Fork 113
fix: set webRoot on browser debugging launch configuration so breakpoints work as expected #713
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
Conversation
…ints work as expected
|
@sheremet-va Let me know if you'd like to try and support the multiple roots, and I can try and reimplement using I have two concerns with doing that:
|
sheremet-va
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some small suggestions
packages/shared/src/index.ts
Outdated
| browser?: { | ||
| provider: string | ||
| name: string | ||
| webRoot?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be optional, root is always defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made these to optional because of the worker-legacy project.
I wasn't sure if legacy in this sense was a "don't touch unless absolutely neededtype of thing, as making this required causes an error in that project when it's getting thebrowser` objects.
My latest commit make it required and updates the worker-legacy project to resolve the error. Let me know if I should roll that back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
legacy just means "not vitest 4", the extension should till work there (unfortunately)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, well the change is there now as well :)
| browser?: { | ||
| provider: string | ||
| name: string | ||
| webRoot?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be optional, root is always defined
|
Thanks! |
This fixes #712 when debugging via the browser and setting breakpoints within VSCode when using project style configurations.
Using the loaded Vitest configurations (thanks @sheremet-va for the point in the right direction), it will set the
webRooton the browserDebugConfigurationto therootdefined in the configuration for the tests attempting to be debugged.The logic gathers all roots for all tests requested for execution, but if multiple different roots are found, it will log a
DEBUGmessage to the console instead throwing an error like the other Browser scenarios. Debugging still works when set in the test file itself, but may not catch when set in source files.