fleetlint Policy for a fleet of repositories
v0.7
Getting started

slop/trivial-asserts

No assertions that cannot fail

Severityinfo
Tiersall
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.4.0
Selected byfleetlint-slop@v0.4.0

Requirement

No test asserts a constant (expect(true).toBe(true), assert True).

Why

It raises coverage and tests nothing.

Check

For each item in:

codegrep("test", r'expect\((true|1)\)\.(toBe|toEqual)\((true|1)\)|assert\s+True\b|assertTrue\(true\)|assert!\(true\)|expect\(true,\s*(isTrue|true)\)')
false

Fix

Assert the behaviour, or delete the test.

Agent instruction: Replace with an assertion on the observable outcome; delete the test if there is none.

Sources


Generated by fleetlint docs from catalog v0.4.0.