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/restore-mocks.md.
close
  • English
  • restoreMocks

    • Type: boolean
    • Default: false
    • CLI: --restoreMocks

    Automatically reset mock state before every test.

    When restoreMocks enabled, rstest will call .restoreAllMocks() before each test.

    CLI
    rstest.config.ts
    npx rstest --restoreMocks