Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

How to Write Unit Tests - Unit Testing Tutorial

Scrimba via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Learn the fundamentals of unit testing in this comprehensive tutorial. Discover why testing is crucial for all developers, regardless of experience level, and how it enhances code confidence, reduces stress, and accelerates delivery. Explore key concepts including test grouping, test cases, debugging with focus, spies, and mocks. Practice your skills with numerous coding challenges throughout the course. Gain hands-on experience setting up Jasmine from scratch, understanding the three parts of testing, and using various matchers like toBeDefined() and toEqual(). By the end of this one-hour and 25-minute tutorial, you'll have a solid foundation in unit testing techniques that you can immediately apply to your projects.

Syllabus

- Introduction to Unit Testing
- Introduction to Jasmine
- Setting up Jasmine from scratch
- Understanding the three parts of testing
- Testing setup breakdown
- Grouping with describe
- Grouping with describe - code challenge
- Our first test
- Our first test - code challenge
- Setting up data with beforeEach
- Setting up data with beforeEach - code challenge
- Skipping and Focussing introduction
- Skipping and Focussing - code challenge
- Unit Testing spies! ️
- Spies - code challenge
- Mocks and debug with me!
- Mocks - code challenge
- Additional matchers: toBeDefined and toEqual
- Additional matchers - code challenge
- Final code challenge
- Unit Testing Outro

Taught by

Scrimba

Reviews

Start your review of How to Write Unit Tests - Unit Testing Tutorial

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.