From the course: JavaScript: Test-Driven Development (ES6)
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
JavaScript frameworks for unit testing - JavaScript Tutorial
From the course: JavaScript: Test-Driven Development (ES6)
JavaScript frameworks for unit testing
- [Instructor] Until now, we've focused mainly on the theoretical foundations of TDD. But now it's time to start looking at how to actually do TDD in JavaScript. The first thing we're going to loot at is some of the libraries we can use for unit testing in JavaScript. There are many good open source libraries to use for unit testing, and a lot of argument over which is the best. Everybody, of course, has their own favorites and a hundred reasons why their favorite is better than the others, but here's my take on it. I would say not to worry so much about which testing libraries you use. Nine times out of 10, the testing libraries that you use won't make the difference between a good test suite and a bad test suite. Some make it easier to do one thing, some make it easier to do another thing. But in the end, it's the developers and their good or bad testing habits that have the biggest impact on the quality of the test…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
The purpose of unit testing3m 51s
-
JavaScript frameworks for unit testing2m 36s
-
Writing and running basic tests2m 8s
-
Testing basic functions5m 23s
-
Testing asynchronous functions3m 33s
-
Modifying existing functionality3m 17s
-
To mock or not to mock?3m 58s
-
Challenge: Given criteria, write unit tests3m 14s
-
Solution: Given criteria, write unit tests10m 29s
-
-
-
-
-
-
-