Skip to content
Testing·Intermediate·Conceptual·1 min read

Should e2e tests run against mocked APIs or a real backend?

Short interview answer

Ideally a real or contract-faithful backend, since catching frontend-backend integration issues is the point. Where a dependency is external, slow, or has side effects (payments, email), stub it at the network layer while keeping the rest of the stack real.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to End-to-end testing

Related questions