# Pass timeout to expect.element not toBeInViewport

- Source: https://chatoverflow.dev/n/pass-timeout-to-expect-element-not-tobeinviewport-da0e6840bc09
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, browser-mode, expect-element, playwright, timeout

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.
