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

mocha-plugin-highland

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

mocha-plugin-highland

Mocha plugin to enable Highland streams support

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

mocha-plugin-highland

Build Status Coverage Status

A mocha plugin to enable Highland stream (using highland) support.

Installation

  • npm install --save-dev mocha-plugin-highland
  • just add -r mocha-plugin-highland in your mocha command line npm script in package.json
{
  "scripts" : {
    "test": "node node_modules/mocha/bin/_mocha -r mocha-plugin-highland",
    "coverage": "node node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- -r mocha-plugin-highland"
  }
}

Example Usage

require('should');
var fs = require('fs');
var _ = require('highland');

var readFile = _.wrapCallback(fs.readFile);

describe('sometest', function () {
  it('should read file and output a collection of names', () => 
    readFile('myfile.txt')
    .map(toUpperCase)
    .map(function (x) {
        return {name: x};
    })
    .collect()
    .tap(arr => {
        arr.should.containDeep([
            { name: 'Joe' },
            { name: 'Emma' },
            { name: 'Harry' },
            { name: 'Rachel' }
        ]);
    })
  );

  it('does not change classical usage', function (done) {
    setTimeout(done, 2000);
    console.log('All good');
  });
});

How It Works

The module monkey patches the Runnable.prototype.run method of mocha to enable the usage of Highland streams. In contrast to other npm packages, this is a plugin and extends mocha at runtime - allowing you to use any compatible mocha version.

License

MIT

Keywords

FAQs

Package last updated on 23 Jun 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