en un clic
testing-guidelines
// Guide for writing tests. Use when adding new functionality, fixing bugs, or when tests are needed. Emphasizes integration tests, real-world fixtures, and regression coverage.
// Guide for writing tests. Use when adding new functionality, fixing bugs, or when tests are needed. Emphasizes integration tests, real-world fixtures, and regression coverage.
| name | testing-guidelines |
| description | Guide for writing tests. Use when adding new functionality, fixing bugs, or when tests are needed. Emphasizes integration tests, real-world fixtures, and regression coverage. |
Follow these principles when writing tests.
ALWAYS mock third-party network services. ALWAYS use fixtures based on real-world data.
foo@example.com, user-123)Focus on end-to-end style tests that validate inputs and outputs, not implementation details.
Don't test every variant of a problem.
When a bug is identified, ALWAYS add a test that would have caught it.
Note: Regression tests are for unintentional broken behavior (bugs), not intentional changes. Intentional feature removals, deprecations, or breaking changes do NOT need regression tests—these are design decisions, not defects.
ALWAYS have at least one basic test for each customer/user entry point.
Note: "Entry point" means the public interface—exported functions, CLI commands, API routes. Internal/private functions are NOT entry points, even if they handle user-facing flags or options. Test entry points; internal functions get coverage through those tests.
Tests are how we validate ANY functionality works before manual testing.
Every test must:
For pure functions without side effects, no special setup is needed—just test inputs and outputs directly.