cucumber-promise
Backwards compatible cucumber promise support.
All these features are implemented in the core cucumber
starting with
version 0.5.0
. If you are using it you don't need cucumber-promise
anymore
Usage
Just wrap your implementation steps function into cpromise
, and
use promises, or implement steps without explicitly calling the
callback function.
var cpromise = require("cucumber-promise").cpromise;
module.exports = cpromise(function() {
this.Given(/^I run a test with cucumber\-promise$/, function(callback) {
callback();
});
this.Then(/^I run code without callbacks$/, function() {
});
this.Then(/^I run a promise call$/, function() {
return new Promise(function(fulfill, reject) {
fulfill();
});
});
});
Install
In order to install this just run:
npm install --save-dev cucumber-promise