O'Reilly logo

Learning Node.js: A Hands-On Guide to Building Web Applications in JavaScript by Marc Wandschneider

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12. Testing

With all the code you have written so far, you’re now ready to look at how to test it to make sure it works. There are many models and paradigms through which this is done, and Node.js supports most of them. This chapter looks at some of the more common ones and then looks at how you can do functional testing of not only synchronous APIs, but also Node’s asynchronous code, and then add some testing to your photo album application.

Choosing a Framework

A few common models of testing are available, including test-driven development (TDD) and behavior-driven development (BDD). The former focuses highly on making sure that all your code is properly exposed to testing (indeed, in many cases, demanding that you write no code until you’ve ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required