Skip to content

QA-TEST-001 — Focused test committed ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-TEST-001.

FieldValue
Severityerror
Confidencehigh
Tierquarantine
Measured FP rate60% (n=20)
Evidence levelE2
QA impactFalse-green risk (FALSE-GREEN)
False-positive risk (author estimate)low
Autofix availableyes
Languagestypescript, javascript
Frameworksjest, vitest, playwright, mocha
Detection strategyLEXICAL
Introduced inv0.1.0

Why this fails in production ​

.only/test.only/it.only restricts a test run to just the marked test(s) — that's the entire point of the API, for local debugging. Committed and pushed, it does the same thing in CI: the rest of the suite silently does not run at all. The build goes green because the one test that ran passed, while every other test in that file (or, in some runners, the whole project) contributed nothing to that result. This is the single easiest way to make a CI pipeline lie, because it requires no malice — just forgetting to remove a debugging aid before committing.

What gets flagged (real detector output) ​

`.only` focus modifier committed.

Example from this rule's own must-fire fixture: tests/fixtures/QA-TEST-001/must-fire/focused.spec.ts

The fix ​

Remove .only before committing.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-TEST-001/must-not-fire/clean.spec.ts — 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-fixtures11
vitest-dev-vitest12

Released under the MIT License.