Jest · Method
jest.requireMock
jest.requireMock(moduleName) returns a mocked module instead of the actual module. It bypasses Jest's normal checks for choosing how the module should be loaded.
Last updated
Syntax
jest.requireMock(moduleName)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
jest.mockjest.requireActualjest.createMockFromModulejest.unmock