test-driven-development
Installation
SKILL.md
Test-Driven Development (TDD)
When to use this skill
- Starting a new complex feature.
- Fixing a bug (write test to reproduce first).
- Refactoring critical paths.
1. The Cycle (Red-Green-Refactor)
- Red: Write a failing test that defines the desired behavior.
- Green: Write the minimum code to pass the test.
- Refactor: Clean up the code while keeping tests green.
2. Tools & Config
- PHP: Use Pest or PHPUnit.
php artisan test(Laravel).
- JS/TS: Use Jest or Vitest.
npm test.