close

clearMocks

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

Automatically clear mock calls, instances, contexts and results before every test.

When clearMocks enabled, rstest will call .clearAllMocks() before each test.

CLI
rstest.config.ts
npx rstest --clearMocks