Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Test Driven Development using Javascript and Jest
Rating: 4.1 out of 5(170 ratings)
4,325 students

Test Driven Development using Javascript and Jest

Learn how to use TDD to become a better problem solver
Created byMark Robson
Last updated 10/2023
English

What you'll learn

  • Test driven development using Javascript and Jest
  • Jest testing framework
  • Game of Life algorithm
  • TDD fundamentals
  • Javascript TDD
  • How to write Unit Tests

Course content

4 sections16 lectures1h 27m total length
  • Introduction to Test Driven Development and our project5:38

    This is the introduction to the course.

  • Definitions0:56
  • The TDD Process Demonstration10:12
  • The Test Driven Development Process
  • Structuring tests11:19

    In this section we'll cover what to name your test files and where to put them. We'll cover the elements of tests including: describe, test/it, beforeAll, afterAll, beforeEach, afterEach, skipping tests and only running one test using 'only'. After this you will know how to set up your tests and make assertions.

Requirements

  • Nodejs installed
  • An IDE such as VSCode

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.

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!

Who this course is for:

  • Intermediate to advanced programmers