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
Dispose tester iFrame in browser mode (#5595) should be configurable. #5655
Comments
Thanks for feedback and suggestions. Can you elaborate what your debugging workflow was like? (I don't know what is/was the "correct" way as I don't use debugger much). From what I can guess, I suppose you were using "Source > Page" in devtools to pick up source files (which doesn't exist since v1.5.1): And overall steps would be something like:
Assuming this is what you were doing, it looks like it's still possible to put import { expect, it } from 'vitest'
it('basic', async () => {
debugger;
expect(typeof window).toBe("object");
}) Just for a reference, this is what I tested https://github.com/hi-ogawa/reproductions/tree/main/vitest-browser-debugger |
Generally I was using Ctrl + P in Chrome DevTools. When the iFrames are destroyed, it removes those files from the list.
Yes these are the steps I am using. I had found the workaround about adding Ideally I would have the behaviour configurable, like it describes in the original ticket, that can be configured using |
I don't think it makes any sense to base it on I think |
Can I propose leaving iFrames with failed tests open? That would at least shorten some of the iteration time to finding the cause of issues? |
This doesn't solve the problem if all tests have failed. |
Fair, if the failures caused by memory/WebSocket issues are not obvious. I will use the workaround for now. Is there a reason why just having the option as part of the config was dropped? There is nothing on the original ticket to describe what happened there even though it's part of the feature description? |
Because removing the iframe is required to function properly right now. |
No problem, obviously missing some context here, will close the ticket. Thanks for the responses. |
Clear and concise description of the problem
After updating Vitest to 1.5.2 I found that it was no longer possible to use DevTools in the browser to look at the test files and add breakpoints etc, since #5595 now destroys the iFrame after the tests have been run.
Suggested solution
Make this behaviour configurable as discussed in the ticket.
Alternative
No response
Additional context
After reading the documentation and mutliple tickets raised here, I believe that the only way to debug tests in Browser mode is via DevTools on the controlled browser instance? If this is true, then #5595 as an implementation is slightly more confusing.
What is the current "correct" way to debug/examine/step through tests in Browser mode, assuming #5595 is correct?
Validations
The text was updated successfully, but these errors were encountered: