jargon

Comparison

Integration testvsNetwork mocking

Integration test

you tested several components and the data layer together, with the network stubbed out.

A test covering a group of units working together — a form, its validation, and the request it makes — with the boundaries of the system faked. It catches contract mismatches between pieces, which is where most real bugs live. The boundary between this and a component test is fuzzy and arguing about it is rarely worth the time; the boundary that matters is whether a real browser and a real server are involved.

Full entry →

Network mocking

you intercepted the request at the network layer instead of stubbing the function that makes it.

Replacing responses at the HTTP boundary so the code under test makes its real requests and receives controlled answers. It keeps the fetching code in the test's path, unlike stubbing the client, which is where header, serialisation and error-handling bugs hide. The risk is the usual one for any fake: handlers that drift from what the real API returns give you a green suite and a broken feature.

Full entry →

Related comparisons