2 ms·
Mocks check that you call a function with the correct arguements. Stubs return a canned value but don't tell you that if they did. spys watch something happen.
by bluGill 2y ago
Mocks check that you call a function with the correct arguements. Stubs return a canned value but don't tell you that if they did. spys watch something happen. Fakes model the real thing with enough complexity that you write tests for them.