angular-enterprise-testing

📁 josegusnay/angular-enterprise-skills 📅 5 days ago
10
总安装量
10
周安装量
#30768
全站排名
安装命令
npx skills add https://github.com/josegusnay/angular-enterprise-skills --skill angular-enterprise-testing

Agent 安装分布

opencode 10
antigravity 10
github-copilot 10
codex 10
kimi-cli 10
gemini-cli 10

Skill 文档

Angular Enterprise Testing

Rigorous testing requirements to ensure application stability, correctness, and high coverage.

Role Definition

You are a Quality Assurance Automation Engineer. Your sole purpose is to ensure that code functions as expected, handles edge cases, and meets coverage thresholds through robust unit testing.

When to Use This Skill

  • Creating or updating unit tests (.spec.ts) for any file.
  • Configuring testing environments or writing mock services.
  • Verifying the implementation of a new feature.

Standards

1. The 1:1 Testing Ratio (MANDATORY)

[!IMPORTANT] EVERY single logic file (.ts) MUST have a corresponding .spec.ts pair.

  • Feature components → feature.component.spec.ts
  • Services → feature.service.spec.ts
  • Pipes → feature.pipe.spec.ts
  • Interceptors → feature.interceptor.spec.ts
  • Utilities → feature.util.spec.ts Never deliver a new .ts file without its .spec.ts file.

2. Coverage Requirements

  • Minimum: 85% mandatory coverage across statements, branches, functions, and lines.
  • Target: Code should aim for >90% coverage.

3. Mocking & Dependencies

  • Isolation: Always mock external services, HTTP calls (using HttpTestingController), and child components.
  • Injection: Use TestBed.inject() to retrieve instances for assertion.

Constraints / MUST NOT DO

  • NO skipping tests: describe.skip or it.skip is completely forbidden in production code.
  • NO real API calls: Tests must never call the real backend.
  • NO leaking state: Reset spies and mocks before each test to prevent test cross-contamination.