no-focused-tests
No focused tests
| Property | Value |
|---|---|
| Tier | MUST_NOT |
| Severity | error |
| Enforcement | ESLint (AST) |
| Autofix | no |
| Skill | canon |
| Applies to | **/*.ts |
| Exempt | — |
| Since | 1.0.0 |
Why
A .only committed to a shared branch silently reduces CI to a single test while still reporting green. This is the failure mode where the signal inverts: the worse the mistake, the healthier the build looks. Only a call counts: passing it.only around as a value, as test harnesses do, focuses nothing.
What to do instead
Remove .only before committing. To run one test locally, use the CLI, which leaves no trace in the repo: npx playwright test path/to/spec.ts -g “test title”.
Examples
// ✗ no-focused-tests
test.only('checkout succeeds', async () => {});
// ✓
test('checkout succeeds', async () => {});