Serverless — End-to-End Testing

Develop end-to-end tests for our serverless application.

alpha2phi
5 min readApr 14, 2022
Serverless — End-to-End Testing

For our serverless application, we use Vitest and Mock Service Worker as our test framework. For component testing, we use Storybook. In the previous article, we configured Cypress but we are yet to use it for end-to-end testing.

In this article, we are going to

  • Use Cypress to develop an end-to-end test with an intercepted response.
  • Use Cypress to develop an end-to-end test against the AWS AppSync GraphQL service.

This article is part of the Serverless for Beginners series.

The source code can be found in this repository.

Getting Started

We installed and configured Cypress and the React helper package in the previous article. Using the React helper package makes it easy to test the React components.

As an example, let’s create a test component -frontend/src/components/Welcome.tsx with the following test code.

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.