Skip to content

bmustiata/cucumber-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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() {
    // the old way works
    this.Given(/^I run a test with cucumber\-promise$/, function(callback) {
        callback();
    });

    // code without callbacks works
    this.Then(/^I run code without callbacks$/, function() {
        // if no callback it's present, this also works
    });

    // and promises also work
    this.Then(/^I run a promise call$/, function() {
        return new Promise(function(fulfill, reject) {
            // promise resolving
            fulfill();
        });
    });
});

Install

In order to install this just run:

npm install --save-dev cucumber-promise

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published