Angular Mocking Patterns

0•

Provides standardized implementation guides and code patterns for mocking services, HTTP requests, and dependencies in Angular test suites.

The Angular Mocking Patterns skill serves as a comprehensive reference for developers building robust unit and integration tests. It offers production-ready implementation patterns for various test doubles—including stubs, spies, and fakes—specifically tailored for the Angular ecosystem. By providing detailed templates for Jasmine spies, HttpClientTestingModule, and Observable streams, this skill helps developers isolate units of code, simulate complex edge cases, and ensure high test coverage without the overhead of real external dependencies.

주요 기능

01Comprehensive guides for creating Dummies, Stubs, Spies, Mocks, and Fakes.
02Detailed Jasmine spy configurations for methods, properties, and custom return values.
03Specific implementation strategies for mocking Angular Routers, Forms, and LocalStorage.
04Robust templates for handling complex RxJS Observable and Promise-based mocking.
050 GitHub stars
06Standardized HTTP mocking patterns using HttpClientTestingModule and HttpTestingController.

사용 사례

01Isolating Angular services by mocking complex external dependencies and API calls.
02Verifying component interaction logic by spying on service methods and tracking call counts.
03Simulating diverse HTTP scenarios including success responses, 404/500 errors, and network failures.