Infinite loop in prettyDOM calls crashes test when locator.element() is not found #7249
Open
6 tasks done
Labels
feat: browser
Issues and PRs related to the browser runner
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
In
vitest/packages/browser/src/client/tester/public-utils.ts
Line 58 in 345d281
stringify
and invitest/packages/utils/src/display.ts
Line 77 in 345d281
Infinity / 2 = Infinity
, the code enters in a loop and ends up crashing the page.Reproduction
Found it in private big project (can only be reproduced if the DOM is large enough to enter the
result.length >= MAX_LENGTH
check. Maybe we can reproduce it by adding a unit test where we send a really small maxDepth and the whole page as object.System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: