DEV Community

Mirela Prifti for Effect

Posted on • Originally published at matechs.com on

Frontend Testing With Typescript - Workshop

This course is for Typescript developers who are eager to learn how to build modern, robust, and testable front-end applications.

Front-End Testing with Typescript — Workshop

In this 5-day (4h/day) workshop we will explore a handful of techniques to test frontend applications using pure typescript in combination with jest, testing-library and cypress, we will primarily use react apps as examples but the techniques are generally usable with any other framework.

👉 Grab your ticket below — November 2021:

  1. London Edition
  2. Berlin Edition
  3. NYC Edition
  4. San Francisco Edition

Regardless of the environment or the language, you are developing in testable code can be described by the sentence “program to an interface, not to a concrete implementation”.

In fact, every time we program-to an interface we can provide multiple implementations of the same contract (the “interface”) and this property comes in handy when we write our tests.

At the architecture level, testable applications tend to look like an onion, where each layer glues together functionalities from outer layers and provides functionalities to inner layers up to the very core of the app.

In the front-end, this concept can be viewed as the separation between UI and business logic, and separation between business logic and integration logic.

In react we will make use of pure functional components to represent the view layer and we will make utilities around the context API to carry business logic and integration logic to our components.

In the tests we will see how to test each component individually from the core UI up to the integration with the external world, we will discuss what properties to assert on each layer and we will see how to use code coverage tools to better understand the branching of our code and to spot what needs further testing.


Top comments (0)