Skip to content
Fallow home
All docs pages

Docs home

Test-only branches

What a test-only-branch finding of fallow audit means, why it matters and how to fix it.

What it reports

The change adds a test-environment branch to source code.

Changed code explains how fallow finds it.

Why it matters

The tests run a path that production never runs. A passing test then does not prove that the production path works.

Example

A change adds if (process.env.NODE_ENV === 'test') return cached; to src/pricing.ts.

Fix

Prefer a seam that tests can inject, such as a parameter or a module mock. If the branch is intended, suppress it with // fallow-ignore-next-line test-only-branch.

Facts

FactValue
Issue typetest-only-branch
Rule id in SARIF outputfallow/test-only-branch
Commandfallow audit
Default severitywarn
Config key in rulestest-only-branch
Suppression comment// fallow-ignore-next-line test-only-branch
Fixable with fallow fixNo
Opt-inNo