angular-testing

Write unit and integration tests for Angular v21+ components and services.

Updated Jan 25, 2026
One-click install
npx skills add https://github.com/ROU-Technology/ng-utils --skill angular-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/ROU-Technology/ng-utils/tree/main/.agents/skills/angular-testing
Command: npx skills add https://github.com/ROU-Technology/ng-utils --skill angular-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about angular-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Angular signal-based components with OnPush change detection?

To test Angular signal-based components, configure TestBed with the standalone component and trigger change detection to verify signal updates. This Skill provides patterns using Vitest or Jasmine to validate signal behavior and ensure OnPush components render correctly during unit tests.

Can I use Vitest instead of Jasmine for Angular v21+ testing?

Yes, you can use Vitest instead of Jasmine for Angular v21+ testing. This Skill supports a unified testing approach, allowing you to write unit and integration tests for components and services using either Vitest or Jasmine as your test runner.

How do I mock HTTP interactions in Angular services using inject()?

To mock HTTP interactions in Angular services using inject(), set up HttpClientTestingModule and use HttpTestingController to simulate HTTP calls. This Skill outlines how to mock dependencies and verify service behavior with TestBed-based tests.

What is the best way to write integration tests for Angular standalone components?

The best way to write integration tests for Angular standalone components is using TestBed to configure the testing module with the component and its dependencies. This Skill offers clear patterns for creating test suites that validate component behavior and HTTP interactions using Vitest or Jasmine.

Do I need component harnesses for Angular unit testing?

Component harnesses are optional for Angular unit testing but useful for simulating user interactions. This Skill covers testing with optional component harnesses alongside TestBed, Vitest, or Jasmine to validate component behavior thoroughly.