angular-unit-test

Generate Angular unit tests with Vitest for components, services, pipes, and directives.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/Shockwave2k/team-claude-skills --skill angular-unit-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-unit-test
Source: https://github.com/Shockwave2k/team-claude-skills/tree/main/skills/frontend/angular-unit-test
Command: npx skills add https://github.com/Shockwave2k/team-claude-skills --skill angular-unit-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates, scaffolds, and fixes Angular 21 unit tests using Vitest to speed up development and ensure test coverage across components, services, pipes, and directives.

Core Features & Use Cases

  • Generates test templates for standalone components, NgModule-based components, services, pipes, and directives.
  • Handles common Angular testing patterns (TestBed, ComponentFixture, signals in Angular 16+, OnPush change detection, ActivatedRoute and HTTP testing).
  • Provides guidance for best practices, naming conventions, and edge-case handling to ensure reliable tests.

Quick Start

Generate unit tests for a given Angular 21 component or service using Vitest and follow the standard Angular testing patterns.

Frequently Asked Questions about angular-unit-test

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

FAQPage Schema
How do I generate unit tests for Angular standalone components using Vitest?

To generate unit tests for Angular standalone components using Vitest, the Skill detects standalone patterns and outputs production-ready test templates with TestBed configuration, ComponentFixture setup, and OnPush change detection handling.

Can I use Vitest to test Angular signals and reactive forms?

Yes, Vitest can test Angular signals and reactive forms. The Skill creates test doubles and mocks tailored for Angular 16+ signals and provides specific testing patterns for reactive form controls and their value changes.

What's the best way to migrate Jasmine tests to Vitest in an Angular project?

The best way to migrate Jasmine tests to Vitest in an Angular project involves applying provided migration guidance. The Skill helps convert existing Jasmine test patterns into Vitest equivalents while maintaining standard TestBed configurations.

How do I mock HttpClient and ActivatedRoute when testing Angular services with Vitest?

To mock HttpClient and ActivatedRoute when testing Angular services with Vitest, the Skill automatically generates necessary test doubles and mocks. It handles HTTP testing interactions and ActivatedRoute mocking to isolate service logic.

Does this approach support NgModule-based components or only standalone components?

This approach supports both NgModule-based components and standalone components. The Skill detects the specific Angular pattern used and scaffolds the appropriate Vitest unit test configuration for each component type.