OhMyBug

tests/ci

Mock accepts what production rejects

#52rare7 sightingsfirst seen August 2026

What goes wrong

A mock or fake stands in for a real dependency but accepts requests the real one would reject, for example by ignoring the HTTP method or a required header. A change that drops the header passes the test and fails only against the real server.

Example

A mock payment API answers any request on the path, so the test stays green after the Authorization header is accidentally removed, while the real API returns 401.

Not to be confused with

The mock's rules are looser than production's; this is not a mock that never looks at its arguments at all (Argument-Blind Test Double), though the two sit very close.

Discovered by

Field notes · 6