Migrated from Method backlog
GitHub Issues are now the live work tracker. Repository docs remain Method evidence.
| Field |
Value |
| Source backlog |
docs/method/backlog/cool-ideas/DX_no-conditional-returns-in-tests.md |
| Archived source |
docs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/cool-ideas/DX_no-conditional-returns-in-tests.md |
| Original lane |
cool-ideas |
| Original id |
DX_no-conditional-returns-in-tests |
| Original legend |
DX |
| Original feature |
testing-quality |
Original backlog card
Ban conditional early returns in test bodies
Idea
The test quality audit found multiple tests using
if (!result) { return; } which makes them vacuous — they pass when
the code is broken because they exit before assertions. A simple lint
rule: flag return statements inside it() callbacks that aren't
inside helper functions. The rule: "every it() block must reach at
least one expect() on every code path."
This is the single most impactful test quality rule from the audit.
Could be implemented as a custom ESLint rule or a vitest plugin that
counts expect() calls and warns when a test exits with zero
assertions.
Migrated from Method backlog
GitHub Issues are now the live work tracker. Repository docs remain Method evidence.
docs/method/backlog/cool-ideas/DX_no-conditional-returns-in-tests.mddocs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/cool-ideas/DX_no-conditional-returns-in-tests.mdcool-ideasDX_no-conditional-returns-in-testsDXtesting-qualityOriginal backlog card
Ban conditional early returns in test bodies
Idea
The test quality audit found multiple tests using
if (!result) { return; }which makes them vacuous — they pass whenthe code is broken because they exit before assertions. A simple lint
rule: flag
returnstatements insideit()callbacks that aren'tinside helper functions. The rule: "every
it()block must reach atleast one
expect()on every code path."This is the single most impactful test quality rule from the audit.
Could be implemented as a custom ESLint rule or a vitest plugin that
counts
expect()calls and warns when a test exits with zeroassertions.