Skip to content

QA-TEST-010 — Empty test body ​

← Back to the rule catalog

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

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

Why this fails in production ​

An empty test body (or a body that's effectively a no-op, like a single comment) reports "passed" for the same reason an assertion-less test does — nothing threw, so nothing failed. It commonly appears as scaffolding left behind after a refactor: the test's setup and teardown got deleted along with the code under test, but the it(...) block itself stayed, quietly padding the test count while verifying nothing.

What gets flagged (real detector output) ​

Test has an empty body — it can never fail.

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

The fix ​

Implement the test or remove it.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-TEST-010/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
cypress-io-kitchensink1
getsentry-sentry1
grafana-grafana2
negative-fixtures3
playwright-community-eslint-plugin-playwright165
positive-fixtures11
tanstack-query2
vercel-next-js201
vitest-dev-vitest218
withastro-astro1

Released under the MIT License.