Testing
test/no-focused-tests
No focused tests (.only, fit, fdescribe) are committed; they silently skip the rest of the suite.
seriousstaticfe-testing
Why
One .only left in a commit makes the runner execute that test alone and report success. CI turns green while every other test is skipped, so regressions merge unnoticed.
Fix
Remove .only, fit and fdescribe before committing. Make CI refuse them: Playwright forbidOnly: !!process.env.CI, Vitest --allowOnly=false (the default in CI), or the lint rules vitest/no-focused-tests, jest/no-focused-tests, mocha/no-exclusive-tests for Cypress.
Examples
// bad
it.only('adds an item', () => {})
// good
it('adds an item', () => {})Sources
Facts
- Id
test/no-focused-tests- Severity
- serious
- Check
- static checked in the source by
audit - Applies to
jsx- Only in projects with
vitestjestplaywrightcypress- Taught by the skill
fe-testingFront-end testing- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain test/no-focused-tests