Skip to content

QA-CYP-002 — Focused test (.only) ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-CYP-002.

FieldValue
Severityerror
Confidencehigh
Tierquarantine
Measured FP rate0% (n=10)
Evidence levelE2
QA impactFalse-green risk (FALSE-GREEN)
False-positive risk (author estimate)low
Autofix availableno
Languagestypescript, javascript
Frameworkscypress
Detection strategyLEXICAL (it/describe/context .only member-call shape on the code-only text view)
Introduced inv0.6.0

Why this fails in production ​

A Cypress it.only/describe.only committed to the shared suite silently de-schedules every other test: npx cypress run executes the focused subset and reports a green run over it, so CI coverage collapses to whatever the last debugging session left focused. Unlike a skipped test (which announces itself as skipped in the report), the de-scheduled tests simply never appear — the run looks complete while covering a fraction of the suite.

What gets flagged (real detector output) ​

`it.only` focuses a single test — everything else is de-scheduled.

Example from this rule's own must-fire fixture: tests/fixtures/QA-CYP-002/must-fire/dashboard.cy.js

The fix ​

Remove .only before committing; focus locally, never in the shared suite.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-CYP-002/must-not-fire/dashboard.cy.js — a legitimate, similar-looking pattern this rule correctly leaves alone.

Corpus-measured false-positive risk ​

Real occurrence counts from npm run corpus:audit against actively-maintained OSS repos — reproduce yourself, don't just trust this table (see the false-positive audit):

RepoOccurrences
positive-fixtures3

Released under the MIT License.