What problem does it solve?
PolicyEngine projects often require consistent, well-documented test practices across frontend apps, APIs, SDKs, and standalone tools. This skill standardizes how tests and fixtures are written to improve maintainability and coverage. Not for country model packages, which use YAML-based tests with their own conventions.
Core Features & Use Cases
- Given-When-Then Naming: Test names follow the pattern test__given_X_condition__then_Y_occurs to promote readability and traceability.
- One Test File Per Source File: Each source file gets a single corresponding test file, mirroring the source directory structure.
- Fixtures Live Separately: Mocks, setup code, and data live in fixtures, keeping tests focused on Given-When-Then logic and expectations.
- Test Edge Cases and Failure Paths: Cover happy paths, boundary values, error paths, nulls, and type coercion traps.
- Structured Describe Blocks: Group tests by function under describe blocks to make coverage obvious.
Quick Start
Create a new skill directory with a SKILL.md frontmatter and implement test-writing conventions (Given-When-Then naming, fixture separation, and edge-case coverage) as described.