Default mock for the window.print
call in browser mode
#7375
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
Clear and concise description of the problem
I see there are default mocks for the
window.confirm
,window.alert
, etc... calls but nothing forprint
.Given this open, unaddressed and seemingly un-workaroundable issue: #7290 (and the linked issues within), I cannot mock my
reactToPrint
module within my tests, so the print window pops up, and on my CI tests, it hangs the runner. Ive tried to mock the print call myself, but cant seem to get it right.Suggested solution
Add a default mock for the
window.print
call:https://github.com/vitest-dev/vitest/blob/main/packages/browser/src/client/tester/dialog.ts#L21-L25
(i think)
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: