angular-testing

Write Angular v21+ unit and integration tests with Vitest or Jasmine.

3|2|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/ngx-signal-forms/ngx-signal-forms --skill angular-testing-ngx-signal-forms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/ngx-signal-forms/ngx-signal-forms/tree/main/.github/skills/angular-testing
Command: npx skills add https://github.com/ngx-signal-forms/ngx-signal-forms --skill angular-testing-ngx-signal-forms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write unit and integration tests for Angular v21+ applications using Vitest or Jasmine with TestBed, component harnesses, and modern testing patterns. Use for testing components with signals, OnPush change detection, services with inject(), and HTTP interactions. Triggers on test creation, testing signal-based components, mocking dependencies, or setting up test infrastructure.

Core Features & Use Cases

  • Supports Vitest and Jasmine for Angular testing workflows.
  • Demonstrates testing signals, OnPush components, and tests with TestBed and component harnesses.
  • Provides guidance for mocking dependencies and testing HTTP interactions in unit/integration scenarios.
  • Includes patterns for test infrastructure setup and reusable test utilities.

Quick Start

Create a new Angular test using the angular-testing skill, then run tests with Vitest or Jasmine.

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 components using signals and OnPush change detection?

To write unit tests for Angular signal components with OnPush, use TestBed to configure the testing module and component harnesses to interact with the UI. This approach supports modern testing patterns for both Vitest and Jasmine test runners in Angular v21+ applications.

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

Yes, you can use Vitest instead of Jasmine for Angular testing workflows. The testing setup supports both frameworks, allowing you to configure test infrastructure, mock dependencies, and execute integration tests for signal-based components and HTTP interactions.

What's the best way to test services using inject() and HTTP interactions in Angular?

The best way to test services using inject() and HTTP interactions is through TestBed configuration and mock dependencies. This setup validates service logic and HTTP requests in unit and integration testing scenarios using either Vitest or Jasmine.

How do I set up test infrastructure and reusable utilities for Angular v21+ applications?

You set up test infrastructure for Angular v21+ applications by configuring Vitest or Jasmine, defining TestBed modules, and creating reusable test utilities. This foundation enables consistent mocking and testing of components, signals, and HTTP interactions.

Does Angular TestBed work with component harnesses for testing signal-based components?

Yes, Angular TestBed works seamlessly with component harnesses for testing signal-based components. This combination allows you to simulate user interactions, verify OnPush change detection behavior, and validate component state in unit and integration tests.

Why do I need to mock dependencies when testing Angular components with signals?

You need to mock dependencies when testing Angular components with signals to isolate component logic and prevent side effects from inject() services or HTTP interactions. This ensures reliable and predictable Vitest or Jasmine test execution.