June 2021
Intermediate to advanced
398 pages
9h 35m
English
Testing JavaScript code is notoriously difficult. Because JavaScript typically runs in a browser environment and interacts closely with the DOM and user behavior, it is often challenging to write tests that have value and are consistent and fast.
When thinking about testing JavaScript, it’s helpful to think about what you want to get out of testing. In this chapter, we’ll focus on two goals:
Using tests to validate that the code is doing the things we think it is doing
Using tests to help development by allowing us to rapidly run situations that would take a long time to recreate manually
While a wide variety of testing tools are available in JavaScript, in this chapter, our focus is on end-to-end testing with ...