angular-testing

Write Angular unit and integration tests using Vitest or Jasmine.

39|6|Updated Apr 22, 2025
One-click install
npx skills add https://github.com/danielsogl/copilot-workflow-demo --skill angular-testing-danielsogl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/danielsogl/copilot-workflow-demo/tree/main/.agents/skills/angular-testing
Command: npx skills add https://github.com/danielsogl/copilot-workflow-demo --skill angular-testing-danielsogl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Write reliable unit and integration tests for Angular apps using Vitest or Jasmine, with guidance on testing signals, OnPush components, and HTTP interactions.

Core Features & Use Cases

  • Vitest and Jasmine workflows for Angular v21+ projects
  • Testing signals, standalone components, and services with inject()
  • Mocking dependencies and setting up test infrastructure for scalable tests
  • Use case: quickly scaffold tests for a new feature and ensure proper test coverage

Quick Start

Create a simple unit test for a standalone Angular component using TestBed and Vitest or Jasmine to verify basic 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 components using Vitest instead of Jasmine?

You can test Angular components using Vitest by leveraging provided workflows that support standalone components and TestBed configuration, allowing you to scaffold and execute unit tests with a fast Vitest runner.

What is the best way to test signals in Angular components?

Testing signals in Angular components involves using specific patterns that validate signal-based state changes within standalone components, ensuring your signal logic updates correctly during unit test execution.

How do I mock HTTP interactions in Angular unit tests?

Mocking HTTP interactions in Angular unit tests requires setting up test infrastructure that intercepts service requests, allowing you to validate HTTP client responses and simulate backend dependencies without real network calls.

Can I test OnPush change detection in Angular with these testing patterns?

Yes, you can test OnPush change detection in Angular by applying specific test patterns that manually trigger change detection cycles, verifying that your components render correctly under strict OnPush performance optimizations.

Does this Angular testing approach support modern dependency injection with inject()?

Yes, this Angular testing approach fully supports modern dependency injection by providing patterns to mock dependencies provided through the inject() function, ensuring proper isolation for your service and component tests.