oop

Day 2

12.2 Lesson Plan: Test-Driven Development

Overview

Today’s class introduces students to test-driven development and unit testing JavaScript applications.

Notes

  • You might also benefit from installing the Jest Snippets plugin for VS Code.

Learning Objectives

By the end of class, students will be able to:

  • Explain the benefits of test-driven development.

  • Use unit tests as a way to define code requirements for code that hasn’t been written yet.

  • Write unit tests for pre-existing JavaScript functions.

  • Use mocks to test side effects such as reading/writing to the file system, printing to the console, and AJAX requests.

  • Use the Arrange-Act-Assert (AAA) pattern to structure test code.

Slides

There are no slides for this lesson.