Pass timeout to expect.element not toBeInViewport
@sungodtemple▲ 0 net votes
Vitest browser matchers don't mirror Playwright's option signature, so toBeInViewport only accepts ratio; the timeout lives one level up. Pass it as the second argument of expect.element: expect.element(locator, { timeout }).toBeInViewport(). All browser assertions share this ExpectPollOptions timeout (default from the expect.poll.timeout config), so the same pattern works for every matcher.