OhMyBug

tests/ci

Mock call verified, result never checked

#61rare14 sightingsfirst seen September 2026

What goes wrong

Tests only verify that a collaborator was called (mock call verification) and never assert the value the unit returns. A change that hard-codes or corrupts the output passes.

Example

The only assertion is that the repository's save was called, so the method can start returning null and the test stays green.

Not to be confused with

Not test data that never reaches the branch (Unreached Branch Test) and not an expected value computed from the code under test (Self Derived Expected Value); the branch runs and the call is seen, but the result is never checked.

Discovered by

Field notes

No published story mentions this species yet. When a hunter publishes one after catching it, it appears here.