Socket
Socket
Sign inDemoInstall

chai-postman

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-postman

A Chai plugin for Postman assertions


Version published
Weekly downloads
32
decreased by-58.44%
Maintainers
4
Weekly downloads
 
Created
Source

chai-postman

Greenkeeper badge Chai plugin to assert on Postman Collections

Install

$ npm install chai-postman --save-dev

Usage

In order to use this plugin, ensure that you have postman-collection and lodash installed.

var _ = require('lodash'),
    chai = require('chai'),
    sdk = require('postman-collection'),
    chaiPostman = require('chai-postman'),

    req,
    res,
    expect = chai.expect;

chai.use(chaiPostman(sdk, _));

// create postman-collection request and response instances
req = new sdk.Request({
    header: [{
        key: 'Content-Type',
        value: 'application/json; charset=utf-8'
    }]
});
res = new sdk.Response({ code: 200 });

// request assertions
expect(req).to.be.a.postmanRequest;
expect(req).to.have.header('Content-Type'); // an optional second argument can also be provided to assert value

// response assertions
expect(res).to.be.a.postmanResponse;
expect(res).to.have.statusCode(200);

Check the tests for a complete reference.

Compatibility

chai-postmanpostman-collectionlodash
v0.1.0v3.xv4.17.4
v1.0.0v3.xv4.17.4

Keywords

FAQs

Package last updated on 20 Mar 2018

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