Rule reference

no-focused-tests

No focused tests

PropertyValue
TierMUST_NOT
Severityerror
EnforcementESLint (AST)
Autofixno
Skillcanon
Applies to**/*.ts
Exempt—
Since1.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 () => {});