Find the perfect coding resourcesLearn more

Introduction to Unit Testing

ScrimbaScrimba
Recommended
Meet Your Instructor
Dylan C. Israel avatar

Dylan C. Israel

Instructor

Dylan Israel runs the popular YouTube channel Coding Tutorials 360 and has created multiple successful Scrimba courses. He specializes in teaching JavaScript and modern web development technologies.

1h 26m

Completion

Certificate included

Format

Interactive coding

Subscription

What You'll Learn

Introduction to Jasmine testing framework

Setting up Jasmine from scratch

Understanding the 3 A's of testing (Arrange, Act, Assert)

Grouping tests with describe blocks

Writing your first unit tests

Overview

Unit testing is in high demand, with good reason! Testing your code allows you to check that your logic works as expected every time, giving you code confidence, lowering stress levels, and allowing you to deliver faster results. This course covers test grouping, test cases, debugging tests with focus, spies and more in just one hour, and contains plenty of challenges to cement your new knowledge. You'll also learn about the 3 A's (Arrange, Act, Assert), and, of course, write plenty of tests. The earlier you start incorporating unit tests into your code base, the better - but it's never too late. That means that this course is suitable for both newbie coders and those already working in the field who want to level up. Knowledge of Unit Testing removes coding doubts, leads to faster development, and reduces bugs, so do your future self a favor and learn Unit Testing today.

Table of Contents
1
Introduction2:30
2
Introduction to Jasmine3:45
3
Setting Up Jasmine from Scratch5:20
4
Understanding the 3 parts of testing4:15
5
Testing Setup Breakdown3:30
6
Grouping with describe4:10
7
Grouping with describe (Challenge)3:25
8
Our first test5:45
9
Our first test (Challenge)4:20
10
Setting Up Data with beforeEach()4:50
11
Setting Up Our Data with beforeEach (Challenge)3:40
12
Skipping and Focusing Introduction3:55
13
Skipping and Focusing (Challenge)3:15
14
Unit Testing: Spies 🕵️6:20
15
Spy Challenge 🕵️4:35
16
Mocks + Debug with me! 🪲5:40
17
Mocks Challenge4:25
18
Additional matchers: toBeDefined() & toEqual()4:15
19
Additional Matchers Challenge3:30
20
Final Challenge5:20
21
Outro2:10

Share Your Experience

Sign in to leave a review and help others

No reviews yet. Be the first to review!