Test Driven Development using Javascript and Jest
Learn how to use TDD to become a better problem solver

What you will learn

Test driven development using Javascript and Jest

Jest testing framework

Game of Life algorithm

TDD fundamentals

Javascript TDD

How to write Unit Tests

Description

Ever wondered what Test-Driven Development (TDD) truly is? Dive in as we demystify this powerful approach through a hands-on coding challenge.

We’ll delve into the world of unit tests, uncovering their role in solving complex tasks in digestible chunks.

Join us as we construct a ‘Game of Life’ simulation with a twist: writing unit tests comes first.

We’ll use Jest to create these tests, piecing together our project in achievable steps until we bring it to life within a browser. Experience the pragmatism of TDD and unit testing firsthand, navigating this course as our co-driver.


Get Instant Notification of New Courses on our Telegram channel.


Keep in mind that our approach may not cater to all tastes; we encourage you to explore a few free videos to see if we’re a match. Our focus is pure, unadulterated JavaScript – no React, no frameworks. We value your satisfaction, and would rather offer a refund than have you leave unsatisfied.

Many believe TDD to be a complex maze, but we’re here to show you its simplicity and elegance! Our course outline? We start with an end goal, like ‘construct a Game of Life’, then atomise it into manageable tasks. If you’ve worked in a software company, you’d recognise these as user stories. For every selected task, we’ll ask: “What tests would prove that this task functions as expected?” Then, the journey unfolds:

  1. Dissect the task and enumerate the tests required for a ‘Done’ stamp
  2. Heed Kent Beck’s advice – “start small or not at all”, by writing the simplest test and corresponding code to pass
  3. Stub out dependencies
  4. Gradually transition constants to variables, moving from specific to generic

Excited? Let’s turn complexity into simplicity, one test at a time!

English
language

Content

Introduction

Introduction to Test Driven Development and our project
Definitions
The Test Driven Development Process
Structuring tests

Task Introduction

Understanding the Task
System Setup

Game of Life algorithm

The Game of Life algorithm
The generate function
The countNeighbours function

Game of Life in the browser

The drawGrid function
The attachGridEventHandler function
The getCellsFromDom function
The start function
The stop function
Integration with the browser
Demo