Skip to content

QA-TEST-003 — Test with no assertions ​

← Back to the rule catalog

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

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

Why this fails in production ​

A test with no assertion (expect/assert call, in any variant) can execute every line of application code, throw zero exceptions, and still verify nothing whatsoever. Test runners report it as "passed" because nothing failed — but nothing was ever checked either. This is qualitatively worse than a missing test, because a missing test is at least visible as a coverage gap; an assertion-less test occupies a green checkmark's worth of false confidence while providing none of the actual guarantee. The same mechanism applies identically across languages — QA-PY-105, QA-JV-103, and QA-CS-103 are this exact failure mode in pytest, JUnit, and NUnit/xUnit respectively.

What gets flagged (real detector output) ​

Test contains no assertions.

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

The fix ​

Add an assertion on the expected outcome, or remove the test.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-TEST-003/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
apache-airflow52
appsmithorg-appsmith37
calcom-cal119
cypress-io-cypress-realworld-app4
cypress-io-kitchensink9
cypress-realworld-app4
dubinc-dub17
getsentry-sentry199
grafana-grafana417
Humanizr-Humanizer1
keycloak-keycloak309
negative-fixtures14
nextauthjs-next-auth3
playwright-community-eslint-plugin-playwright165
positive-fixtures69
puppeteer-puppeteer90
SeleniumHQ-selenium1
streamlit-streamlit8
sveltejs-kit62
tanstack-query19
vercel-next-js1391
vitejs-vite39
vitest-dev-vitest568
withastro-astro101
yarnpkg-berry89

Released under the MIT License.