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

mocha-pipe

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-pipe

Build a test pipeline with mocha

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

mocha-pipe

Build a test pipeline with mocha

Build Status Coverage Status NPM version Downloads David devDependencies Status GitHub issues license GitHub stars Built with love Powered by mocha

Gittip

NPM

mocha-pipe

mocha-pipe allows you to define your tests as a series of asynchronous units of work. Collectively the individual steps make up the pipeline. Each step pipes its output into the next step. If any uncaught exception occurs, the pipe is considered broken, and the step which threw the error will show as broken. The pipe returns a promise which will be resolved with the result from the last step.

Install

npm install --save-dev mocha-pipe
# or
yarn add -D mocha-pipe

Basic Example

const mochaPipe = require('mocha-pipe');

const steps = [{
    name: 'Get user', // passed to it(name, ...);
    before: () => 'MOCHA_PIPE',
    execute: (username) => getUser(username),
    after: res => assertSomething(res)
}, {
    name: 'Update user email',
    execute: user => updateEmail(user, 'a@b.com'),
    after: res => assertSomething(res)
}, {
    name: 'Expect 401 on invalid password',
    execute: user => authenticate(user, 'bad password').catch(err => assertStatusCode(err, '401')) 
}];

const pipeline = mochaPipe({
    name: 'Basic Example', // passed to describe(name, ...);
    steps
});

pipeline.run();

Keywords

FAQs

Package last updated on 19 Nov 2017

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