|
Resets the state of all mocks |
jest.clearAllTimers()
|
Removes any pending timers from the timer system |
jest.disableAutomock()
|
Disables automatic mocking in the module loader |
jest.enableAutomock()
|
Enables automatic mocking in the module loader |
jest.fn(?implementation)
|
Returns a new, unused mock function |
jest.isMockFunction(fn)
|
Determines if the given function is a mocked function |
jest.genMockFromModule(moduleName)
|
Generate a mocked version of the module for you |
jest.mock(moduleName, ?factory, ?options)
|
Mocks a module with an auto-mocked version |
|
Resets the module registry - the cache of all required modules |
|
Exhausts the micro-task queue |
|
Exhausts the macro-task queue |
jest.runAllImmediates()
|
Exhausts all tasks queued by setImmediate()
|
jest.runTimersToTime(msToRun)
|
Executes only the macro task queue |
jest.runOnlyPendingTimers()
|
Executes only the macro-tasks that are currently pending |
jest.setMock(moduleName, moduleExports)
|
Explicitly supplies the mock object that the module system should return for the specified module |
jest.unmock(moduleName)
|
Indicates that the module system should never return a mocked version of the specified module |
|
Instructs Jest to use fake versions of the standard timer functions |
|
Instructs Jest to use the real versions of the standard timer functions |