Question 5 of 10Pro Only
What is mocking in testing? How do you mock functions, modules, and API calls in Jest?
Sample answer preview
## What is Mocking? Mocking is **replacing real implementations with controlled fake versions** to: - Isolate the code under test - Control external dependencies - Make tests faster and deterministic - Avoid side effects (API calls, database writes) ## Mock Functions (jest.fn)…
mockingjest.fnjest.mockspyOnMSWfetch mock