Spirolo

weak-assertion

Assertions that check a value exists without checking what it is.

hiddenDROPPED

12 / 34 true, 95% Wilson interval 0.21 to 0.52, on 17 open-source projects.

Shown with --all. Never gates, even with an override.

Hidden by default

Its review dropped it: most of its findings were checks like expect(screen.queryByText('Saved')).toBeTruthy(), where the query already carries the expected value.

It still runs: spirolo check --all shows its findings, labelled, and it never fails the build, even with an override.

What it reports

The test never compares what the code produced with an expected value: every assertion only checks that a result exists (truthy, defined, not null). The code could return a wrong result and the test would still pass.

What to do

Compare the result with the value it should have: toBe, toEqual, toHaveTextContent.

spirolo explain weak-assertion prints the same claim and status from your installed binary.

On this page