Chapter 4. Cucumber.js and Gherkin

In the last two chapters we covered how to effectively use Mocha from the point of view of BDD, but Mocha is not the only option we have. There are plenty of test runners that we could have used to implement our BDD tests. Other tools such as Vows (http://vowsjs.org/) work perfectly well (some claim even better than Mocha) to do BDD. However, I have chosen Mocha because it is the most popular tool and because all the things that you have learned with it can be easily applied to other tools. Nonetheless, I would not consider this book complete if I did not show you another tool for comparison purposes, and this tool is Cucumber.js.

In this chapter:

  • We will explore how to write BDD features using Gherkin
  • You will ...

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.