testing-base
Enforces Head Shakers shared testing conventions for test structure, file naming, description patterns, assertions, and anti-patterns. This base skill is loaded by all test-type specialists.
When & Why to Use This Skill
The Testing Base skill automates the enforcement of standardized testing conventions across unit, component, integration, and E2E tests. It ensures high-quality codebases by validating test structures, naming patterns, and semantic assertions while proactively preventing common anti-patterns like hardcoded data or testing implementation details, leading to more maintainable and reliable software.
Use Cases
- Standardizing test file organization and naming conventions across large-scale engineering teams to maintain project consistency.
- Automating the detection of testing anti-patterns, such as the use of 'test.only' or hardcoded data, during the development and code review process.
- Ensuring the use of semantic and readable assertions (e.g., 'toBeInTheDocument') to improve test clarity and reduce debugging time.
- Onboarding new developers by providing real-time feedback and enforcement of project-specific testing styles and description patterns.
- Validating that asynchronous tests correctly use async/await patterns to prevent flaky tests and false positives.
| name | testing-base |
|---|---|
| description | Enforces project shared testing conventions for test structure, file naming, description patterns, assertions, and anti-patterns. This base skill is loaded by all test-type specialists. |
Testing Base Skill
Purpose
This skill provides shared testing conventions used across all test types (unit, component, integration, E2E). It establishes consistent patterns for test structure, file organization, naming conventions, and common anti-patterns to avoid.
Activation
This skill activates when:
- Creating or modifying any test file (
.test.ts,.test.tsx,.spec.ts) - Working with test setup files in
tests/setup/ - Implementing test factories or mock handlers
Workflow
- Detect testing work (file path contains
tests/or matches test file patterns) - Load
references/Testing-Base-Conventions.md - Apply shared conventions to all test code
- Validate against common anti-patterns
- Report any violations found
Key Patterns (REQUIRED)
Test Structure
- Follow the project's test directory organization
- Use correct file naming patterns for each test type
- Keep test files close to their corresponding source files in the test hierarchy
Description Conventions
- Use
describe/itblocks with clear, behavior-focused descriptions - Organize tests: positive cases first, edge cases, then error cases
- Use globals (no imports needed for
describe/it/expect/vi)
Assertion Patterns
- Use semantic assertions (
toBeInTheDocument,toHaveLength, etc.) - Prefer specific matchers over generic
toBe(true) - Use
async/awaitproperly with async assertions
Anti-Patterns to Avoid
- Never test implementation details
- Never use
test.onlyin committed code - Never skip test cleanup
- Never use arbitrary timeouts
- Never hardcode test data (use factories)
- Never test multiple behaviors in one test
References
references/Testing-Base-Conventions.md- Complete shared testing conventions