close
Rstest
Search
K
指南
配置
API
English
简体中文
Search
K
指南
配置
API
English
简体中文
Menu
API Overview
Filter
当前页面列出了 Rstest 所有的测试 API。
Test API
Expect
expect
expect.not
expect.soft
expect.poll
expect.unreachable
expect.assertions
expect.hasAssertions
expect.addEqualityTesters
expect.addSnapshotSerializer
expect.getState / expect.setState
匹配器(Matchers)
常用匹配器
Mock 匹配器
快照匹配器
Promise 匹配器
不对称匹配器
自定义匹配器
Test
test
test.only
test.skip
test.todo
test.each
test.for
test.fails
test.concurrent
test.sequential
test.runIf
test.skipIf
test.extend
Describe
describe
describe.only
describe.skip
describe.todo
describe.each
describe.for
describe.runIf
describe.skipIf
describe.concurrent
describe.sequential
Hooks
beforeAll
afterAll
beforeEach
afterEach
Rstest Utility
Mock functions
rstest.fn
rstest.spyOn
rstest.isMockFunction
rstest.clearAllMocks
rstest.resetAllMocks
rstest.restoreAllMocks
更多
MockInstance
getMockName
mockName
mockClear
mockReset
mockRestore
getMockImplementation
mockImplementation
mockImplementationOnce
withImplementation
mockReturnThis
mockReturnValue
mockReturnValueOnce
mockResolvedValue
mockResolvedValueOnce
mockRejectedValue
mockRejectedValueOnce
mock
mock.calls
mock.instances
mock.contexts
mock.invocationCallOrder
mock.lastCall
mock.results
mock.settledResults
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
Utilities
rstest.stubEnv
rstest.unstubAllEnvs
rstest.stubGlobal
rstest.unstubAllGlobals
rstest.setConfig
rstest.resetConfig