angular-testing

Test Angular v21+ apps with Vitest or Jasmine.

1.1k|93|Updated Mar 5, 2025
One-click install
npx skills add https://github.com/zard-ui/zardui --skill angular-testing-zard-ui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/zard-ui/zardui/tree/main/.agents/skills/angular-testing
Command: npx skills add https://github.com/zard-ui/zardui --skill angular-testing-zard-ui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Ensures reliable testing for Angular v21+ applications by providing practical guidance and ready-to-use patterns for Vitest or Jasmine.

Core Features & Use Cases

  • Unit and integration tests for Angular components, directives, and services using Vitest or Jasmine.
  • Testing signals and OnPush components with proper change detection and test setup.
  • HTTP and router testing examples, mocks, and patterns to validate data flows and navigation.
  • Component harnesses and testing utilities to simplify complex UI verification.

Quick Start

Install Vitest or Jasmine, configure the Angular test runner, and begin by writing a simple component unit test to validate rendering.

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 signals and OnPush components correctly?

To test Angular signals and OnPush components, you must configure proper change detection within your test setup. This Skill provides concrete code samples to trigger updates and verify rendering using Vitest or Jasmine.

How do I set up Vitest for an Angular v21+ unit testing project?

Setting up Vitest for Angular v21+ involves installing the runner and configuring the test environment. This Skill delivers practical guidance and ready-to-use configuration patterns to start writing component unit tests quickly.

What is the best way to mock HTTP interactions and router testing in Angular?

The best way to mock HTTP interactions and router testing in Angular is using dedicated testing utilities. This Skill provides examples and mock strategies to validate data flows and navigation effectively.

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

Yes, you can use Jasmine instead of Vitest for Angular integration testing. This Skill supports both frameworks, offering patterns for testing services with inject(), forms, and async behaviors.

How do I test services using inject() in Angular v21+?

Testing services using inject() in Angular v21+ requires specific async patterns and mock setups. This Skill provides concrete code samples to validate service dependencies and HTTP interactions.

When do I need inline component harnesses for Angular testing?

You need inline component harnesses for Angular testing to simplify complex UI verification. This Skill provides testing utilities and examples to interact with and validate intricate component behaviors reliably.