Skip to content
StackPractices

Tag: mocking

Browse 8 practical software engineering resources tagged with "mocking". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving mocking.

Mock GraphQL Resolvers for Frontend Development

Set up mocked GraphQL resolvers with Apollo Server so frontend teams can develop against a fake API before the backend is ready

API Mocking for Testing

Build reliable tests by mocking external APIs with WireMock, MockServer, and MSW to eliminate flakiness and test edge cases.

Stub External HTTP Services with WireMock

How to use WireMock in Java tests to stub external HTTP services, including response templating, delay simulation, and stateful mock behavior.

Mock Network Requests with MSW

How to use Mock Service Worker (MSW) to intercept network requests in JavaScript tests and development, including REST and GraphQL mocking.

Mock External APIs with responses Library

How to mock HTTP API calls in Python tests using the responses library, including status codes, headers, JSON bodies, and error simulation.

Test Double: Replace Dependencies with Stubs, Spies, Fakes

How to use test doubles to isolate units under test. Covers stubs, spies, fakes, mocks, and dummy objects with examples in Python, JavaScript, and Java.

Vitest for React: Component, Hook, and Integration Testing

Master Vitest for React testing: component tests with Testing Library, hook tests with renderHook, integration tests, mocking, snapshot testing, and parallel execution.

Software Testing Strategy Guide

A practical guide to building a layered testing strategy with unit, integration, and end-to-end tests.