Open
Conversation
Add comprehensive mock generation utilities for testing and development: - **Mock Client**: Drop-in replacement for BaseClient that returns mock data - **Mock Handlers**: Create mock handlers from HandlerConfig - **Mock Context**: Generate mock contexts for testing - **Zod Mock Generator**: Automatic mock data generation from Zod schemas - **Comprehensive Documentation**: Full guide and examples Features: - Auto-generates mock data from Zod schemas - Supports all common Zod types (primitives, objects, arrays, unions, etc.) - Deterministic generation with seed support - Spy functionality for tracking calls - Network latency simulation - Type-safe throughout Includes: - New package: packages/http-mocks/ - Documentation: docs/guide/mocks.md - Examples: examples/mocks/ - Updated README and build scripts
Add extensive documentation and practical examples for using mocks in frontend development: **Documentation Updates:** - docs/guide/mocks.md: 477 lines of frontend debugging guide - Problem/solution overview - Quick start for frontend developers - Debugging specific scenarios (empty, loading, error, edge cases) - Dev tools component pattern - Framework-specific examples (React, Vue, Svelte) - Pro tips and best practices - Storybook integration - Debugging checklist - packages/http-mocks/README.md: Frontend development section - Why use mocks for frontend - Quick setup guide - Scenario testing patterns - Dev tools component - Framework examples - Complete example reference **New Example:** - examples/frontend-debugging/: Complete React app demonstrating: - Mock/real API client switching - Multiple test scenarios (default, empty, error, large, edge, slow) - Dev tools panel with runtime toggling - TanStack Query integration - Realistic project management UI - Console debug utilities **Key Features:** - ✅ Toggle between mock and real API at runtime - ✅ Test 6 different scenarios easily - ✅ Works offline for development - ✅ Framework-agnostic patterns - ✅ Production-ready examples This makes @adi-family/http-mocks incredibly valuable for frontend developers who want to: - Build UI before backend is ready - Debug edge cases quickly - Work offline - Test error states easily - Develop in isolation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive mock generation utilities for testing and development:
Features:
Includes: