Mocking
Everything on SkillVeris tagged Mocking — collected across the glossary, study notes, blog, and cheat sheets.
6 resources across 1 library
Study Notes(6)
Mocking HTTP Requests
Learn how to mock network calls in Jest tests using axios/fetch stubs, interceptor libraries like nock and msw, and how to simulate error and timeout scenarios.
Mocking Modules with jest.mock()
Understand how jest.mock() replaces entire modules with automatic or manual mocks, and how to combine that with jest.requireActual for partial mocking.
Mocking Timers
Learn how to use Jest's fake timers to control setTimeout, setInterval, and Date deterministically instead of waiting on real wall-clock time in tests.
Mocking API Responses
Use route.fulfill(), routeFromHAR, and route.fetch() to return deterministic, realistic API responses for fast, reliable UI tests.
Stubbing and Mocking API Responses
Learn how to replace real backend responses with controlled, static or dynamic data using cy.intercept() to test UI states reliably.
Mocking and Test Doubles
Learn the five canonical test double types—dummy, stub, spy, mock, and fake—and how to use unittest.mock in Python.