angular-testing

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

713|170|Updated Dec 22, 2020
One-click install
npx skills add https://github.com/huajian123/ng-antd-admin --skill angular-testing-huajian123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/huajian123/ng-antd-admin/tree/main/ui/.agents/skills/angular-testing
Command: npx skills add https://github.com/huajian123/ng-antd-admin --skill angular-testing-huajian123

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps teams automate unit and integration tests for Angular v21+ applications, covering signal-based components, OnPush change detection, service injection patterns, and HTTP interactions to reduce manual QA and regressions.

Core Features & Use Cases

  • Comprehensive Testing: Supports Vitest (recommended) or Jasmine test runners for Angular components, services, and HTTP calls.
  • Modern Patterns: Demonstrates testing signals, standalone components, and harness-based testing techniques across typical app scenarios.
  • Use Case: Ideal for projects migrating to Angular 21+ or adopting signal-based architecture, enabling consistent, maintainable test suites.

Quick Start

Install Vitest or Jasmine, configure Angular testing, and begin writing tests for components using TestBed, signals, and HTTP mocks.

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

Vitest is the recommended test runner for Angular signal-based components, providing configuration support for TestBed setup, HTTP mocking, and verifying signal updates within standalone components using OnPush change detection.

What is the best way to test services using inject() in Angular v21+?

The best way to test services using inject() in Angular v21+ involves configuring TestBed to provide dependencies, enabling automated unit and integration tests for HTTP interactions and injection patterns across front-end modules.

Does this Angular testing approach support Jasmine or only Vitest?

This testing approach supports both Vitest and Jasmine. Vitest is recommended for modern setups, but Jasmine remains fully supported for configuring test infrastructure, mocks, and harness-based testing in Angular v21+ applications.

How do I configure test infrastructure for harness-based testing in Angular?

Configuring test infrastructure for harness-based testing in Angular requires setting up the TestBed environment, mocking HTTP calls, and leveraging component harnesses to interact with standalone components and validate OnPush change detection behavior.

Why do I need to mock HTTP interactions when testing Angular components?

Mocking HTTP interactions when testing Angular components isolates front-end logic from backend services, ensuring reliable unit and integration tests that verify signal updates and service injection patterns without external dependencies.