close
logo
Rstest
指南
配置
API
English
简体中文
指南
配置
API
English
简体中文
logo
Rstest
Overview

Test API

Describe
Test
Hooks

Rstest Utility

Mock functions
Fake timers

API Overview

当前页面列出了 Rstest 所有的测试 API。

Test API

Describe

  • describe
  • describe.only
  • describe.skip
  • describe.todo
  • describe.each
  • describe.for
  • describe.runIf
  • describe.skipIf
  • describe.concurrent
  • describe.sequential

Test

  • test
  • test.only
  • test.skip
  • test.todo
  • test.each
  • test.for
  • test.fails
  • test.concurrent
  • test.sequential
  • test.runIf
  • test.skipIf
  • test.extend

Hooks

  • beforeAll
  • afterAll
  • beforeEach
  • afterEach

Rstest Utility

Mock functions

  • rstest.fn
  • rstest.spyOn
  • rstest.isMockFunction
  • rstest.clearAllMocks
  • rstest.resetAllMocks
  • rstest.restoreAllMocks

Fake timers

  • rstest.useFakeTimers
  • rstest.useRealTimers
  • rstest.isFakeTimers
  • rstest.setSystemTime
  • rstest.getRealSystemTime
  • rstest.runAllTicks
  • rstest.runAllTimers
  • rstest.runAllTimersAsync
  • rstest.runOnlyPendingTimers
  • rstest.runOnlyPendingTimersAsync
  • rstest.advanceTimersByTime
  • rstest.advanceTimersByTimeAsync
  • rstest.advanceTimersToNextTimer
  • rstest.advanceTimersToNextTimerAsync
  • rstest.advanceTimersToNextFrame
  • rstest.getTimerCount
  • rstest.clearAllTimers