New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

examples/config/api.json

2

lib/index.js
exports.ServiceSync = require('./service.gen.sync');
exports.Api = require('./service.api');
exports.version = '0.0.4';
exports.version = '0.0.5';
{
"name": "bluecat",
"version": "0.0.4",
"version": "0.0.5",
"description": "REST API test framework in nodejs",

@@ -11,16 +11,6 @@ "repository": {

"dependencies": {
"grunt-cli": "0.1.13",
"mocha": "~1.18.2",
"request": "2.27.0",
"chai": "~1.9.1",
"fibers": ">=1.0.1",
"config": "~0.4.35",
"hoek": "~1.5.2"
},
"devDependencies": {
"grunt": "~0.4.4",
"grunt-env": "~0.4.1",
"grunt-mocha-test": "~0.10.0",
"grunt-contrib-jshint": "~0.9.2"
}
}

@@ -5,1 +5,65 @@ 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](http://nodejs.org/)
* Install all node package dependencies:
```bash
$ 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:
```javascript
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();
})
})
})
```
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