Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Easy Test Driven Development with TypeScript and Vitest
Highest Rated
Rating: 4.8 out of 5(47 ratings)
358 students
Created byAshley Frieze
Last updated 6/2024
English

What you'll learn

  • Go from Noob to Pro with real-world test driven development
  • Learn a fast effective way of bringing test automation into your coding
  • Understand how vitest allows us to build unit tests that test business logic and UI code
  • Learn how to write the right sorts of tests that add real value to your development
  • See how TDD is done in real life

Course content

6 sections41 lectures6h 11m total length
  • Introduction - Why are we here?5:22

    Why might you be taking this course? What does the course cover? and how will it work?

  • Skip to the Fun Part - a first example6:52

    The first example of TDD, from no code to a working algorithm in a couple of minutes.


    Example code - https://github.com/ashleyfrieze/easy-tdd-typescript/tree/main/vitest/section%201/leap-year-1

  • First example: recap6:22

    The demo in the previous lecture went through a lot of concepts quickly. Let's unpack everything that we did.

  • Back up a minute: Setting up an Environment8:44
    • How to download the sample code

    • How to set up a fresh vitest project

    Working from https://github.com/ashleyfrieze/easy-tdd-typescript/tree/main/vitest/section%201/fresh-project

  • Leap year example, checklists and specs6:36

    Introducing checklists and another feature for the leap year algorithm


    https://github.com/ashleyfrieze/easy-tdd-typescript/tree/main/vitest/section%201/leap-year-2

  • Exercise: finish the leap year algorithm2:24

    A challenge to follow the checklist in 'leap-year-2' from the example code via linktr.ee/ashleyfriezetdd


    Or here - https://github.com/ashleyfrieze/easy-tdd-typescript/tree/main/vitest/section%201/leap-year-2

  • Solution: finish the leap year algorithm5:41

    We look at the solution to the leap year problem, including a little surprise when the "free handling of zero" is affected by the algorithm developing.


    Solution code at https://github.com/ashleyfrieze/easy-tdd-typescript/tree/main/vitest/section%201/leap-year-solution

  • Deriving TDD Principles learned so far4:47

    A recap of the main principles we've learned from TDD so far

Requirements

  • Required: Basic understanding of TypeScript, or moderate understanding of JavaScript

Description

Accelerate your journey from Noob to Pro with real-world Test Driven Development. See how to gain all the benefits of Test Driven Development to speed up and secure your development process.

Led by a professional software engineer, using practical examples, this course will make it easy to write tests during software development, and get better code, without slowing down your development cycle.

Rather than walking through the syntax of the test tooling, this course is intended to put Test Driven Development in context. We will discover when to use certain techniques based on realistic scenarios. This connects the theory with the value of applying it.

This is aimed at people who need to add more test automation to their workflow. We will see how to do this with purpose and style. We will learn how to avoid pitfalls and make sure we're testing the right things.

Topics include:


  • Why we need tests

  • The basics of tests, from setup through to assertions

  • Red/Green/Refactor

  • Code coverage

  • Mocks and Test Doubles

  • Testing code that depends on APIs

  • Keeping control of test code

  • Test first with user interfaces

Though the examples use Vitest, they can also be adapted to their equivalents in the Jest framework.

Who this course is for:

  • Beginners in test automation, or practitioners looking to make their tests more valuable
  • Suitable for software developers who need to add TDD to their toolkit, or test automation specialists
  • Developers who are unsure of how TDD can help them
  • Developers looking to put TDD in context with realistic examples