jargon

Backend & systems·Testing and test doubles

you wrap the real thing, let it do its actual job, and record the calls so you can check them afterwards.

Spy

A double that records how it was used for later assertion, often wrapping a real implementation. Unlike a mock it does not set expectations up front — you assert after the fact, which reads more naturally and couples less. It is the middle ground between a stub that asserts nothing and a mock that asserts everything.

Commonly confused with