Skip to content

QA-PW-142 — Blanket route mock ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-PW-142.

FieldValue
Severitywarning
Confidencemedium
Tierextended
Measured FP rate18% (n=11)
Evidence levelE1
QA impactFlaky-test risk (FLAKY-RISK)
False-positive risk (author estimate)medium
Autofix availableno
Languagestypescript, javascript
Frameworksplaywright
Detection strategyLEXICAL (regex heuristic)
Introduced inv0.3.8

Why this fails in production ​

Catch-all route mocks swallow third-party calls inconsistently across tests: some get mocks, some hit the network. The result depends on test order and which routes were registered first.

What gets flagged (real detector output) ​

`page.route('**/*')` — blanket interception of all requests.

Example from this rule's own must-fire fixture: tests/fixtures/QA-PW-142/must-fire/orders.spec.ts

The fix ​

Intercept specific endpoints (page.route('**/api/orders')) and pass unmatched requests through with route.fallback() or route.continue().

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-PW-142/must-not-fire/orders.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-fixtures8
vercel-next-js3

Released under the MIT License.