A contract test verifies that a consumer and a provider agree on the interface they share, so integration breaks before deployment.
A contract test is an automated check that pins down the expectations between two independently deployed services. The consumer side writes down what it needs: fields, types, status codes, error shapes. The provider side verifies that what it actually ships still satisfies those expectations. When both sides pass, integration is safe. When one side drifts, the test fails before the change reaches production.
The term is often confused with integration testing. An integration test boots the real provider and the real consumer together and asserts end-to-end behaviour. A contract test does not need both services running at once. It captures one side's expectations as an artifact and replays them against the other side in isolation. That isolation is the whole point: it makes the check fast, cheap, and runnable inside a single service's CI pipeline.