Comparing version 0.0.4 to 0.0.5
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(); | ||
}) | ||
}) | ||
}) | ||
``` |
13937
3
0
15
361
69
- Removedchai@~1.9.1
- Removedconfig@~0.4.35
- Removedgrunt-cli@0.1.13
- Removedmocha@~1.18.2
- Removedabbrev@1.1.1(transitive)
- Removedassertion-error@1.0.0(transitive)
- Removedchai@1.9.2(transitive)
- Removedcommander@0.6.12.0.0(transitive)
- Removedconfig@0.4.37(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddeep-eql@0.1.3(transitive)
- Removeddiff@1.0.7(transitive)
- Removedfindup-sync@0.1.3(transitive)
- Removedglob@3.2.113.2.3(transitive)
- Removedgraceful-fs@2.0.3(transitive)
- Removedgrowl@1.7.0(transitive)
- Removedgrunt-cli@0.1.13(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjade@0.26.3(transitive)
- Removedlodash@2.4.2(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.2.140.3.0(transitive)
- Removedmkdirp@0.3.00.3.5(transitive)
- Removedmocha@1.18.2(transitive)
- Removedms@2.1.3(transitive)
- Removednopt@1.0.10(transitive)
- Removedresolve@0.3.1(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedtype-detect@0.1.1(transitive)