mocha-gherkin is a Gherkin-style interface and reporter add-on for mocha. This add-on allows you to describe your features using
But. You can use this interface together with mocha's BDD interface.
Usage in ECMAScript 6
Usage in ECMAScript 5
You should first have mocha installed:
$ npm install mocha
mocha-gherkin, either globally or inside your project:
$ npm install mocha-gherkin
How to Use
mocha-gherkin consists of two different add-ons: interface add-on and reporter add-on. To use
mocha-gherkin, you should first write your features using terms provided by the interface add-on. Then, run
mocha with the options below:
$ mocha tests/addition.feature.js --ui mocha-gherkin --reporter mocha-gherkin/build/spec
What's Going on?
Scenario wrap around mocha's
But do the same thing for mocha's
it, and other mocha's BDD lingos still work as usal, so you can mix in them with the Gherkin-style terms.
mocha-gherkin has currently only one reporter add-on, which extends mocha's
spec with support for the Gherkin-style interface. However, you can use other modules as usual since
mocha-gherkin just wraps around mocha's BDD interface.