angular-testing

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

595|69|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/analogjs/angular-skills --skill angular-testing-analogjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/analogjs/angular-skills/tree/main/skills/angular-testing
Command: npx skills add https://github.com/analogjs/angular-skills --skill angular-testing-analogjs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to write and execute unit and integration tests for Angular v21+ applications using Vitest or Jasmine, focusing on signal-based components, TestBed patterns, and harnesses.

Core Features & Use Cases

  • Test Setup & Execution: Create, configure, and run unit and integration tests for components, services, and directives using Vitest or Jasmine.
  • Signal-Based Testing: Validate signal-based inputs/outputs, OnPush components, and harness-driven interactions.
  • HTTP & Service Testing: Mock HTTP interactions, inject services, and verify data flows in tests.

Quick Start

Install vitest and jasmine adapters, initialize a test module with TestBed, and run tests to verify basic component behavior.

Frequently Asked Questions about angular-testing

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

FAQPage Schema
How do I write Angular tests for signal-based components using Vitest or Jasmine?

Angular tests for signal-based components validate signal inputs and outputs by configuring TestBed with Vitest or Jasmine, verifying OnPush change detection behavior and harness-driven interactions. This approach applies to v21+ apps using inject().

What's the best way to mock HTTP interactions in Angular service tests?

Mocking HTTP interactions in Angular service tests uses TestBed and HTTP testing utilities to inject services and verify data flows. This isolates data layers and validates component behavior without live network requests.

Does Vitest work with Angular TestBed for component integration testing?

Vitest works with Angular TestBed for component integration testing by creating and configuring test modules that validate component behavior. You install vitest adapters and initialize TestBed to run tests across typical UI layers.

How do I test OnPush change detection in Angular components?

Testing OnPush change detection in Angular components involves using component harnesses and TestBed patterns to validate signal-based inputs. This confirms UI updates correctly when signal values change within your testing framework.

Can I use Jasmine to run unit tests for Angular apps with inject() services?

Jasmine runs unit tests for Angular apps using inject() services by configuring TestBed to provide and inject dependencies. This validates service interactions and data flows within typical Angular application layers.