The definitions matter less than the trade-off they encode: the more of the real system a test exercises, the more confidence it gives and the slower and flakier it is.
A workable split:
- Unit — one module, dependencies substituted. Milliseconds. Catches logic errors. Tells you nothing about whether the pieces fit together.
- Integration — several real modules, real database, no browser. Seconds. Catches wiring, schema, and query errors, which is where most real bugs live.
- E2E — the deployed app through a browser. Minutes. Catches "the deploy config is wrong" and little else that the layer below missed.
Most teams over-invest in the ends and under-invest in the middle. If you have a fixed budget, integration tests usually buy the most confidence per second of CI time.