Summary

Producing a quality product is always going to require extensive and repeated testing, which is exactly the sort of thing computers are really good at. Automate as much as possible.

In this chapter, we examined the general form for a test using arrange, act, and assert. We also looked at how to create fake objects to take the place of the components of the system. Finally, we looked at ways to handle interacting with the user interface, a typical pain point in testing.

Testing JavaScript code is an up and coming thing. The tooling around mocking out objects and even the tools for running tests are undergoing constant changes. Being able to use tools such as Node.js to run tests quickly and without having to boot up an entire browser is stunningly ...

Get Mastering JavaScript Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.