Module 7 Introduction

Introduction to module 7: Unit testing

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the The newline Guide to Modernizing an Enterprise React App course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to The newline Guide to Modernizing an Enterprise React App, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course The newline Guide to Modernizing an Enterprise React App
  • [00:00 - 00:14] Up to this point, we've been overhauling our sample's applications code, bringing it up to date with the latest and greatest that React has to offer. Functional components, custom hooks, the context API, all really good stuff.

    [00:15 - 00:25] But modern app code is only one part of what goes into an enterprise level of React app. Another key piece is testing, and specifically for this module, integration testing.

    [00:26 - 00:44] While QA teams can play a crucial role in testing and retesting applications functionality as new features are added, nothing can test every single bit of pre-existing functionality quite like automated tests can. And this is where automated integration tests come into play.

    [00:45 - 01:13] Automated tests are the tests that development teams can write to test that various pieces of functionality of our app work as we expect, and keep working as we expect, even as we modify and add new code. They can run ridiculously fast, faster than a human tester could ever hope to, over and over and over again, performing the exact same test every single time and reassuring us as developers that we're not breaking any functionality.

    [01:14 - 01:23] Which is why in this module we're going to dive into testing, an almost required part of enterprise apps nowadays. So here's what we'll cover.

    [01:24 - 01:48] I'll give you an introduction to React testing library and just why this combination has become the widely accepted testing framework for React apps of all shapes and sizes, and a strategy for testing applications. We'll set up hardware handler to run automated integration tests and code coverage with just a few simple NPM scripts and dev dependency testing libraries.

    [01:49 - 02:05] Plus, I'll show you how to target particular tests, tests suites, and test files. Then we'll get down to the business of writing automated tests, tests for our functional components, tests for our custom hooks, even tests for our API service calls.

    [02:06 - 02:14] Testing is a crucial piece of modern enterprise applications, and I'm excited to show you how I like to approach it. approach it.

    [02:15 - 02:16] You