🎓 View our courses: [ Ссылка ]
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.
In this quick, one-hour tutorial, we dive into what unit testing is and why it is important for all developers, regardless of their confidence and experience.
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.
This course covers test grouping, test cases, debugging tests with focus, spies, and more in just one hour, and it contains plenty of challenges to cement your new knowledge.
💻 Check out this course on Scrimba’s interactive learning platform:
[ Ссылка ]
✨Contents: ✨
00:00 - Introduction to Unit Testing
06:06 - Introduction to Jasmine
08:48 - Setting up Jasmine from scratch
14:50 - Understanding the three parts of testing
16:42 - Testing setup breakdown
18:58 - Grouping with describe()
20:19 - Grouping with describe() - code challenge
22:18 - Our first test
27:46 - Our first test - code challenge
30:27 - Setting up data with beforeEach()
34:31 - Setting up data with beforeEach() - code challenge
41:15 - Skipping and Focussing introduction
43:05 - Skipping and Focussing - code challenge
47:14 - Unit Testing spies! 🕵️
51:15 - Spies - code challenge
57:25 - Mocks and debug with me! 🪲
01:06:45 - Mocks - code challenge
01:11:36 - Additional matchers: toBeDefined() and toEqual()
01:15:16 - Additional matchers - code challenge
01:18:49 - Final code challenge
01:20:41 - Unit Testing Outro
💻 Check out this course on Scrimba’s interactive learning platform:
[ Ссылка ]
🌲 Scrimba's Linktree:
[ Ссылка ]
How to write unit tests | Unit testing tutorial
Теги
unit testingunit testunit testing tutorialwhat is unit testingunit testing exampleunit testing explainedjavascript unit testingunit testing tutorial for beginnersunit testing with exampleunit testing in software testingsoftware testingunit testing frameworkunit testing in software engineeringunit testsunit testing for beginnershow to write unit testswhat are unit testsbenefits of unit testingunit testing toolsunit testing jasmine