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

cucumber-caffeinator

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cucumber-caffeinator

Cucumber.js supercharged with Mocha reporters.

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

cucumber-js-caffeinator Build Status

Cucumber.js supercharged with Mocha reporters (both built-in and third-party).

This project is just a plugin (i.e. it does not replace Cucumber.js in any way. In fact, you have to npm install cucumber prior to cucumber-caffeinator).

Installation

$ npm install --save cucumber-caffeinator

Usage

Imagine you keep your tests under "test" directory as shown bellow:

    test/
      features/
        support/
          world.js
        step_definitions/
          ?.js
          ...
        ?.feature
        ...

Now, depending on how you run cucumber and on the level of coupling you are willing to introduce, you have the following options:

Use cucumber-js (or cucumber.js) shell script as before but with addition of "--require ./node_modules/cucumber-caffeinator/src/index.js --reporter:<mocha's reporter name>".

So, for example, if you are running cucumber-js like so

$ cucumber-js test/features

and all you can think of is "nyan" reporter, then type in

$ cucumber-js --require ./node_modules/cucumber-caffeinator/src/index.js --reporter:nyan --require test/features test/features

and hit enter. To switch between different reporters change the value next to "--reporter:" (e.g. --reporter:spec, --reporter:xunit, ...).

Note the addition of "--require test/features". Cucumber's CLI disables automatic scripts loading on "--require", so you have to add that part as well.

In this case world.js might look like:

var caffeinator = require('cucumber-caffeinator');

module.exports = function() {

    caffeinator.call(this, {
        reporter: process.env.REPORTER || 'spec'
    });

    ...
};

Note that you'll still be able to switch reporters with "--reporter:<mocha's reporter name>". In case of cucumber-js (or cucumber.js) shell script it's as simple as cucumber-js --reporter:nyan test/features.

Changelog

  • 1.1.4 - Fixed pending/fail callbacks advising (by jhenriquez).
  • 1.1.3 - Compatibility with Cucumber.js 0.4.3.
  • 1.1.2 - Fixed "Test duration: NaN".
  • 1.1.1 - Fixed "RangeError: Maximum call stack size exceeded", Cucumber's output suppression.
  • 1.1.0 - Backgrounds support, turned off leaks detection.
  • 1.0.0 - Requires Cucumber.js >=0.4.1. Better compatibility with existing Mocha reporters, optional activation and output formatting.
  • 0.1.0 - Compatible with Cucumber.js <=0.4.0.

License

MIT License

Keywords

FAQs

Package last updated on 01 May 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