OhMyBug

tests/ci

Mock Ignores Call Arguments

#49rare21 sightingsfirst seen September 2026

What goes wrong

A mock or stub answers an outgoing call without recording or matching the arguments that determine the real answer — matched on path only, on the last argument, on a fragment, or on nothing — so a dropped header, a swapped parameter or a call to the wrong target passes every test.

Example

The payment mock returns 'ok' for any call, so code that sends the amount in dollars instead of cents passes every test.

Not to be confused with

The call is reached and answered; not test data that never reaches the call (Unreached Branch Test), not an expected value copied from the implementation (Self Derived Expected Value), and not a mock whose behaviour differs from the real dependency (Test Double Contract Diverges From Real).

Discovered by

Field notes · 11