Angular Testing

Configure Angular v20+ unit tests with Vitest or Jasmine for signal-based components.

1|1|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/svssdeva/agentic-skills --skill angular-testing-svssdeva
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Angular Testing
Source: https://github.com/svssdeva/agentic-skills/tree/main/angular/angular-testing
Command: npx skills add https://github.com/svssdeva/agentic-skills --skill angular-testing-svssdeva

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing reliable tests for modern Angular apps—especially those using signals, standalone components, and OnPush change detection—can be slow and error-prone.

Core Features & Use Cases

  • Modern test setup: Configures Angular v20+ unit tests with Vitest via @angular/build:unit-test, while also covering Jasmine-based workflows.
  • Signal-aware testing: Verifies computed signals, component signal behavior, and deterministic updates when inputs change.
  • Practical component/service coverage: Demonstrates testing standalone components, OnPush components, services (including HTTP), and common async patterns.
  • Dependency mocking & IO testing: Provides patterns for mocking services (including signal-based services), and testing inputs/outputs and HTTP resources.

Quick Start

Use the Angular Testing skill to create a Vitest-based unit test suite for a standalone, signal-driven component, including an HTTP-backed resource and an OnPush change detection assertion.

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 components with Vitest?

To test Angular signal components with Vitest, configure Angular v20+ using @angular/build:unit-test. Verify computed signals, component signal behavior, and deterministic updates by applying modern signal test patterns through TestBed.

What is the best way to unit test standalone Angular components using OnPush change detection?

Unit testing standalone Angular components with OnPush change detection requires correct TestBed configuration. Verify component rendering and signal updates by triggering change detection explicitly to ensure deterministic DOM updates.

How do I mock HTTP services in Angular unit tests?

Mock HTTP services in Angular unit tests using TestBed to provide test doubles. Verify HTTP-backed resources by intercepting service calls and asserting deterministic async flows and response handling.

Can I migrate existing Jasmine Angular tests to Vitest?

You can migrate Jasmine Angular tests to Vitest using the Angular Testing skill. Configure the @angular/build:unit-test builder and adapt existing standalone component, signal, and service mocking patterns to the Vitest workflow.

Why are my Angular signal computed values not updating in unit tests?

Angular signal computed values may not update in unit tests if TestBed change detection is not triggered. Ensure OnPush components and signal dependencies are properly refreshed to verify deterministic updates.

Does Angular Testing support testing signal-based services and dependency mocking?

Angular Testing supports signal-based services and dependency mocking. Use TestBed to inject mock signal services, verify computed logic, and test component inputs and outputs with deterministic mocked data.