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

    • Type: number
    • Default: 10_000
    • CLI: --hookTimeout=10000

    Default timeout of lifecycle hooks (beforeAll, afterAll, beforeEach, afterEach, onTestFinished, and onTestFailed) in milliseconds. Set to 0 to disable the timeout.

    CLI
    rstest.config.ts
    npx rstest --hookTimeout=10000

    Rstest resolves the hook timeout in the following priority order:

    1. The timeout argument passed to an individual hook
    2. File-level timeout set via rs.setConfig({ hookTimeout })
    3. --hookTimeout CLI option
    4. hookTimeout in the configuration file
    5. Default value of 10_000 milliseconds