Socket
Socket
Sign inDemoInstall

chai-gulp-helpers

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chai-gulp-helpers

A simple test helper to verify that your stream returns the expected files.


Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

chai-gulp-helpers

Build Status Coverage Status

This is a chai plugin for testing gulp plugins.

Installation

You can install chai-gulp-helpers via npm:

$ npm install --save-dev chai-gulp-helpers

Usage

Enable the plugin:

var chai = require("chai");
var chaiGulpHelpers = require("chai-gulp-helpers");
chai.use(chaiGulpHelpers);

This gives you two kinds of syntax:

// Verify that two arrays of Vinyl files are equal (have the same files with same content):
expect(fileList1).to.be.sameFilesAs(fileList2);
// Verify that two streams return the equal list of Vinyl files (returns a promise)
expect(stream1).to.produce.sameFilesAs(stream2);

Examples

describe("my gulp plugin", function () {
    it("should do something", function () {
        var expected = gulp.src("./expected/**/*", { base: "./expected/" });
        var actual = gulp.src("./fixtures/**/*", { base: "./fixtures/" })
            .pipe(myGulpPlugin());
        return expect(actual).to.produce.sameFilesAs(expected);
    });
});

This test will pass if the files in fixtures folder processed by your plugin match those in the expected folder.

Keywords

FAQs

Last updated on 27 May 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc