Skip to content

expect_route

Assert against the navigation state — current route name, current route params, or a route’s presence in the stack. Returns ok when the assertion matches; failResult with code=ASSERTION_FAILED otherwise. Differentiated capability over Maestro: Maestro doesn’t know what route you’re on, only what’s rendered. Pass timeoutMs to retry through navigation animations.

NameTypeRequiredDefaultConstraintsDescription
namestringNoAsserts the current top-of-stack route name === this.
paramsEqualsunknownNoAsserts deep-equal against the current route params object.
inStackstringNoAsserts a route with this name exists somewhere in the stack (not necessarily current).
timeoutMsnumberNomin: 0, integerPolling timeout in ms (default 0). Use 1000-2000 to wait through navigation animations.
expect_route()