Writing end-to-end tests for Next.js apps

The emulated test that we made in the previous chapter is OK, but what if we would like to make a full fledged test to verify that everything is good from the end user's perspective? Such tests are called integration tests or end-to-end (e2e) tests.

Unlike unit tests, where we test everything in maximum isolation, module by module, with stubs for external services and so on, this kind of test covers as many modules at once as possible, to make sure all of them work together properly, including integration with third parties. Basically, such a test emulates regular user behavior. The main aim is to make sure that user scenarios work well and all the involved business logic is correct.

This is a very ...

Get Next.js Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.