angular-testing

Guide writing, running, and maintaining Angular tests across Jasmine, Karma, Vitest, Jest, and Cypress.

6|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/oguzhan18/angular-ecosystem-skills --skill angular-testing-oguzhan18
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-testing
Source: https://github.com/oguzhan18/angular-ecosystem-skills/tree/main/skills/angular-testing
Command: npx skills add https://github.com/oguzhan18/angular-ecosystem-skills --skill angular-testing-oguzhan18

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides clear, version-aware guidance to write, run, and maintain reliable tests for Angular applications, reducing flakiness and speeding developer feedback loops.

Core Features & Use Cases

  • Testing frameworks: Covers Jasmine, Karma, Vitest, Jest, Cypress and migration guidance to Vitest as the modern default.
  • Test types: Guidance for unit tests, component tests, service tests, and E2E tests with examples and best practices.
  • Techniques & tooling: Includes TestBed patterns, fakeAsync/tick for async flows, spies and mock services, DOM querying with By.css, HTTP testing with provideHttpClient, and template coverage insights.
  • Use case: Migrate a legacy Karma/Jasmine test suite to Vitest while ensuring template coverage and updating TestBed usage for Angular 21.

Quick Start

Run a Vitest component test for MyComponent and summarize any failing assertions and recommended fixes.

Frequently Asked Questions about angular-testing

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

FAQPage Schema
How do I migrate an Angular test suite from Karma and Jasmine to Vitest?

To migrate Angular tests from Karma and Jasmine to Vitest, you need to update your test runner configuration and adapt TestBed patterns. This Skill provides version-aware migration guidance to ensure compatibility and reduce test flakiness during the transition to Vitest.

What is the best way to test async Angular service flows using fakeAsync and tick?

Testing async Angular service flows with fakeAsync and tick involves wrapping test logic to simulate asynchronous time progression. This Skill provides actionable guidance on applying these techniques alongside TestBed to reliably resolve and verify asynchronous operations in your components.

How do I configure HTTP testing in Angular using provideHttpClient?

Configuring HTTP testing with provideHttpClient allows you to mock backend interactions within TestBed. This Skill details how to set up HTTP testing handlers, verify outgoing requests, and simulate error responses for your Angular services without making real network calls.

Can I measure Angular template coverage to find untested DOM bindings?

Yes, you can measure Angular template coverage to identify untested DOM bindings and event listeners. This Skill offers insights into analyzing template coverage reports, ensuring your component tests interact with all critical elements rendered in the HTML template.

Does this Skill support writing end-to-end tests with Cypress for Angular?

Yes, this Skill supports writing end-to-end tests with Cypress for Angular applications. It provides actionable guidance and best practices for configuring E2E test environments, simulating user interactions, and asserting application behavior across various testing frameworks.

How do I use spies and mock services in Angular TestBed configurations?

Using spies and mock services in Angular TestBed configurations involves overriding provider dependencies to isolate component logic. This Skill explains how to configure TestBed, create test doubles, and assert that specific service methods were called with expected arguments.