What problem does it solve?
This Skill provides practical guidelines and templates to write robust TDD tests for NG Component Pattern methods (e.g., OnModifyDone, OnDirtyLayoutWrapperSwap), reducing flaky tests and enforcing consistency.
Core Features & Use Cases
- Direct method invocation: write tests that call the target methods directly to exercise the intended code paths.
- State reset discipline: reset all potentially interfering state before running tests to ensure clean baselines.
- API verification: use Grep/Read techniques to confirm method names and signatures align with source definitions.
- Branch coverage: create paired tests for true/false branches to improve code coverage.
- No magic numbers: promote named constants to avoid hard-coded values.
- Self-checklist and templates: rely on references/test-template.md and self-checklist.md to maintain quality.
Quick Start
Start by reading the SKILL.md for core principles, then review references/test-template.md for concrete templates. Create independent test cases that directly invoke the target methods, reset state prior to invocation, and verify branch outcomes with appropriate assertions. Use the given naming conventions and avoid magic numbers; run the existing test suite to validate coverage.