api-testing-overview
api-testing-overview
What API testing covers
An API test sends a real HTTP request to a running service and asserts on the response: the status code, the headers, and the body. It is not a unit test (no in-process function calls, no mocking the HTTP layer) and not a UI test (no browser). It exercises one deployed service through its public interface, so it catches serialization bugs, wrong status codes, missing fields, broken auth, and schema drift that unit tests structurally cannot see.
Three consequences shape everything below. The service runs at some URL, so environment configuration is a first-class concern. The service has state, so two tests hitting the same database can interfere. And the response is data rather than a return value, so how well you assert on it is the whole skill.