Summary

Wow! This was a long chapter, but we covered a lot of ground. You learned the basics of Node and NPM, just enough to be able to set up a simple development environment for BDD. Node allows us to execute JavaScript from the command line, something that is essential to perform BDD. With NPM, we can initialize our project, manage its dependencies, and install tools and libraries, such as Mocha and Sinon.

We practiced the test-first cycle, Red/Green/Refactor, using Mocha and Chai. During your first contact with the test-first cycle, you learned not only how to use the tools and libraries but also some useful testing techniques:

  • Adding duplication to your code with triangulation, to expose patterns that help you discover the correct algorithm ...

Get Learning Behavior-driven Development with JavaScript 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.