When mocking a specific function implementation with Jest, you would use the method ________ on the mock.
- mockImplementation
- getMockFunction
- functionMock
- mockedFunction
In Jest, when you want to mock a specific function implementation, you would use the mockImplementation method on the mock. This allows you to define custom behavior for the mocked function, such as returning specific values or throwing errors. The other options are not the correct method for this purpose in Jest.
Loading...
Related Quiz
- When a functional component's output is not affected by changes in props, you can wrap it with ________ to memoize its rendered output.
- How to pretty print JSON with React?
- Do Hooks replace render props and higher order components?
- How do you access the imperative API of web components?
- What is the purpose of displayName class property?