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

bluecat

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluecat

Generic REST API Test Framework

  • 0.2.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Bluecat

NPM version Dependency Status Downloads

A REST API testing framework built on node.js that makes testing API endpoints straightforward.

  • Define your APIs in a json file, Bluecat will create all the methods for you
  • Callbacks are removed so tests that have a complex API call flow will be more clear
  • Full control over the request URL query, headers and body in test case
  • Automatically maintains session cookies for you for HTTP API call flows

Installation

$ npm install bluecat

Simple Sample Usage

  • First define your API in config/api.json:
{
  "mobileapi": {
    "typeahead": {
      "schema": "http",
      "method": ["GET"]
      }
  }
}

  • Then in your test suite (example, using Mocha):
var expect = require('chai').expect;
var Bluecat = require('bluecat');
var Api = Bluecat.Api('mobileapi');

describe('typeahead service test suite', function() {

  before(function() {
    t = new Bluecat.ServiceSync(Api, 'mobile.walmart.com');
  })

  it('typeahead?term=toy&cat=0&num=8', function(done) {
    t.run(function() {
      // send GET to typeahead?term=toy&cat=0&num=8
      var r = t.typeahead.GET({
        term: 'xbox',
        cat: 8,
        num: 0
      });

      // verify response
      expect(r.err).to.equal(null);
      expect(r.data.statusCode).to.equal(200);
      expect(r.data.body).to.have.ownProperty('specific');
      done();
    })
  })
})

License

Licensed under the MIT

Keywords

FAQs

Package last updated on 30 Mar 2015

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