For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /config/test/expect.md.
close
  • English
  • expect

    • Type: ExpectConfig
    • Default: { poll: { interval: 50, timeout: 1000 } } (timeout: 5000 in Browser Mode)

    Configure the defaults used by expect.poll(). Browser Mode uses a 5000ms default poll timeout, while Node Mode uses 1000ms. An implicit default is limited by the remaining current test phase; options passed directly to expect.poll() take precedence and are not capped by this calculation. expect.poll() remains test-only: it can use the active timeout of per-test hooks and fixtures, but it is not available in beforeAll or afterAll.

    rstest.config.ts
    import { defineConfig } from '@rstest/core';
    
    export default defineConfig({
      expect: {
        poll: {
          interval: 100,
          timeout: 5000,
        },
      },
    });

    expect.poll

    Global configuration for polling assertions.

    expect.poll.interval

    • Type: number
    • Default: 50

    The interval between retry attempts, in milliseconds.

    expect.poll.timeout

    • Type: number
    • Default: 1000 (5000 in Browser Mode)

    The maximum total polling time before the assertion fails, in milliseconds. When omitted at the call site, the configured value is also capped by the remaining current test phase.