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

REST API test framework in nodejs

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bluecat

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

Just define your APIs in a json file, Bluecat will create all the methods for you, plus it removes callbacks so tests that have a complex API call flow will be more clear.

Installation

  • Install Node.js >= v0.10.25 and npm
  • Install all node package dependencies:
$ npm install

Write Test

  • Define your API in config/api.json
  • Test case example (using Mocha):

First define your API in config/api.json:

{
  "mobileapi": {
    "typeahead": {
      "schema": "http",
      "method": ["GET"]
      }
  }
}

Then in your test suite:

var expect = require("chai").expect;
var ServiceSync = require("bluecat").ServiceSync;
var Api = require("bluecat").Api;

var host = 'mobile.walmart.com';

describe("typeahead service", function() {

  before(function() {
    t = new ServiceSync(Api("mobileapi"), host);
  })

  it("typeahead?term=xbo&cat=0&num=8", function(done) {
    t.run(function() {
      // send GET to typeahead?term=xbo&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();
    })
  })
})

Keywords

FAQs

Package last updated on 31 Mar 2014

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