🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Spy

In plain terms

A test double that records how it was called.

Going deeper

A spy wraps or stands in for a dependency and records information about calls (arguments, count) so tests can verify interactions. It observes behavior.

Under the hood

Can wrap real objects to record while still executing; verifies that something was called as expected.

Examples

Verifying callbacks fired, call counts, interaction testing, Jasmine spies.

Think of it like...

Like a hidden observer noting exactly who called and what they said.

Feedback & Bug Report