var Yadda = require('yadda');
Yadda.plugins.mocha();
feature('./features/bottles.feature', function(feature) {
var library = require('./bottles-library');
var yadda = new Yadda.Yadda(library);
scenarios(feature.scenarios, function(scenario, done) {
yadda.yadda(scenario.steps, done);
});
});
还有专题文件。
Feature: Mocha Asynchronous Example
Scenario: A bottle falls from the wall
Given 100 green bottles are standing on the wall
when 1 green bottle accidentally falls
then there are 99 green bottles standing on the wall
输出..。
Mocha Asynchronous Example
✓ A bottle falls from the wall
1 passing (12ms)