angular-testing

Test Angular v21+ components and services with Vitest or Jasmine.

1|Updated Oct 12, 2022
One-click install
npx skills add https://github.com/plastikaweb/plastikspace --skill angular-testing-plastikaweb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/plastikaweb/plastikspace/tree/main/.agents/skills/angular-testing
Command: npx skills add https://github.com/plastikaweb/plastikspace --skill angular-testing-plastikaweb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write comprehensive unit and integration tests for Angular v21+ applications using Vitest or Jasmine with TestBed, component harnesses, and modern testing patterns. Use for testing components with signals, OnPush change detection, services with inject(), and HTTP interactions. Triggers on test creation, testing signal-based components, mocking dependencies, or setting up test infrastructure.

Core Features & Use Cases

  • Vitest and Jasmine-based testing workflows for Angular v21+ apps.
  • Component tests with TestBed, standalone components, and component harness patterns.
  • Tests for signals, OnPush change detection, and HTTP interactions; mocking services and dependencies.
  • Use cases include creating unit tests, integration tests, and test infrastructure setup for new Angular projects.

Quick Start

Start by adding a new test file for an Angular component, configure TestBed, and run the test suite with Vitest or Jasmine.

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 using TestBed?

To test Angular signal-based components using TestBed, you configure the testing module with the standalone component, instantiate it, and assert signal state changes. This skill provides code samples for testing signals and modern change detection patterns.

Can I use Vitest instead of Jasmine for Angular v21+ testing?

Yes, you can use Vitest instead of Jasmine for Angular v21+ testing. This skill enables both Vitest and Jasmine workflows, providing structured guidance for unit and integration tests using TestBed, component harnesses, and modern testing patterns.

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

The best way to mock HTTP interactions in Angular integration tests is using HttpClientTestingModule. This skill explains patterns for mocking dependencies, testing HTTP interactions, and setting up test infrastructure for Angular v21+ apps.

How do I test Angular components with OnPush change detection?

To test Angular components with OnPush change detection, you use component harnesses and trigger change detection manually. This skill provides patterns for testing OnPush components, signal-based state, and standalone components.

Does this Angular testing skill work with services using inject()?

Yes, this skill works with services using inject(). It provides structured guidance for mocking dependencies and testing services that use the modern inject() pattern in Angular v21+ apps.