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

cukestall

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cukestall

Cucumber.js in-browser runner

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CukeStall

DISCLAIMER This project is at its experimental stage. It's not tested and might be buggy.

A Cucumber.js runner for browsers Node.js middleware.

CukeStall lets you run a Cucumber feature suite against a Node.js web application right from your web browser.

Usage

Plug CukeStall connect middleware into your app to serve it to the browser:

var connect   = require('connect');
var CukeStall = require('cukestall');

var app = connect();
app.use(connect.logger('test'));
// your app code goes here ...

app.use(CukeStall.runner({
  featurePaths: [__dirname + '/features/my.feature'],
  stepDefsPaths: [__dirname + '/features/step_definitions/stepdefs.js'],
  supportCodePaths: [__dirname + '/features/support/cukestall.js']
}));

app.listen(1337);

Your application is now running normally at localhost:1337 and CukeStall is reachable on localhost:1337/cukestall.

Backdoors

It is common to perform "short-circuit" actions from within step definitions and hooks. For example, you might need to wipe out the whole database before every scenario. To do so, you can use backdoors.

Backdoors are routes added on top of your existing application.

app.use(CukeStall.runner({
  featurePaths: [__dirname + '/features/my.feature'],
  stepDefsPaths: [__dirname + '/features/step_definitions/stepdefs.js'],
  supportCodePaths: [__dirname + '/features/support/cukestall.js']
  backdoors: {
    reset_all: function (req, res, next) {
      // this backdoor will allow a step definition on the browser side
      // to empty the database:
      MyDb.dropAll();
      res.end("DB emptied.");
    }
  }
}));

The backdoor can be triggered by POSTing to localhost:1337/cukestall/reset_all:

// features/support/cukestall.js

this.Before(function (callback) {
  $.post('/cukestall/reset_all', null, function (results, textStatus, jqXHR) {
    callback();
  });
});

FAQs

Package last updated on 06 May 2012

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