Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cucumber-promise

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cucumber-promise

Backwards compatible cucumber promise support

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 08 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc