angular-testing

Write unit and integration tests for Angular v20+ apps with Vitest or Jasmine.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/alexander-kastil/advanced-angular-agentic-swe --skill angular-testing-alexander-kastil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/alexander-kastil/advanced-angular-agentic-swe/tree/main/.github/skills/angular-testing
Command: npx skills add https://github.com/alexander-kastil/advanced-angular-agentic-swe --skill angular-testing-alexander-kastil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine, focusing on modern testing patterns, signals, OnPush change detection, and HTTP interactions.

Core Features & Use Cases

  • Testing Angular v20+ components and services with Vitest or Jasmine
  • Guidance for test infrastructure, TestBed setup, explicit imports, and mocks
  • Use cases covering signal-based components, dependency injections, and HTTP requests

Quick Start

Create the first unit test for an Angular component following the patterns described in this Skill.

Frequently Asked Questions about angular-testing

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

FAQPage Schema
How do I write unit tests for Angular signal-based components?

To test Angular signal-based components, configure TestBed with a proper buildTarget, use explicit Vitest imports, and apply specific patterns for interacting with signals to verify state changes.

Can I use Vitest instead of Jasmine for Angular v20 testing?

Yes, Vitest can be used for Angular v20 testing. This approach enforces explicit imports, proper TestBed configuration with a buildTarget, and the avoidance of jsdom to ensure reliable component and service testing.

What is the best way to set up TestBed for OnPush change detection components?

The best way to set up TestBed for OnPush components involves configuring TestBed with a buildTarget and avoiding jsdom. This setup ensures correct change detection triggering during signal updates and HTTP interactions.

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

To test HTTP interactions in Angular services using inject(), establish test infrastructure with TestBed, mock dependencies, and apply specific HTTP testing patterns to verify request and response handling.

Why does my Angular testing setup require explicit Vitest imports?

Explicit Vitest imports are required to prevent scope pollution and ensure that mocking, spying, and test creation triggers execute correctly within the Angular TestBed environment for v20+ applications.