What problem does it solve?
Many Angular apps struggle to maintain reliable tests that cover components using signals, OnPush change detection, and services via inject(), especially when integrating with HTTP interactions. This Skill provides a clear pattern for writing unit and integration tests in Angular v21+ using Vitest or Jasmine, TestBed, and optional component harnesses.
Core Features & Use Cases
- Unified testing approach: write unit and integration tests for components, services, and HTTP interactions.
- Signal-aware testing: test components using signals with proper change detection and harness usage.
- End-to-end testing patterns: mock dependencies, simulate HTTP calls, and verify behavior with TestBed-based tests.
- Use Case: For a large Angular app using signals and OnPush, create a test suite that validates component behavior and HTTP interactions across Vitest or Jasmine.
Quick Start
Install Vitest Angular tooling and write a basic test for a standalone component, e.g., a CounterComponent, to verify creation and increment behavior.