HoangNguyen0403

Testing

Standards for Component Test Harnesses and TestBed.

HoangNguyen0403 501 148 Updated 4mo ago

Resources

1
GitHub

Install

npx skillscat add hoangnguyen0403/agent-skills-standard/testing

Install via the SkillsCat registry.

SKILL.md

Testing

Priority: P1 (HIGH)

Principles

  • Harnesses: Always use ComponentTestHarness (Angular Material Harnesses) to interact with components. Avoid querying DOM/CSS selectors directly.
  • Provider Mocks: Use provideHttpClientTesting() instead of mocking HttpClient manually.
  • Signal Testing: Signals update synchronously. No need for fakeAsync usually.

Guidelines

  • Avoid logic: Tests should just assert inputs and outputs.
  • Spectator: Consider using libraries like @ngneat/spectator for cleaner boilerplate if allowed.

References