0.1.9 • Published 8 years ago

nodecaller v0.1.9

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

nodecaller

Allows to easily chain calls to server and test rest APIs.

Sample Usage

function done(err){
  console.log(err? ('An error occurred: ' + err) : 'Call successful');
}

var caller = new Caller('http://localhost.com:3000/api/');
caller
  .path('ok')
  .get() //Expects 200, no other checks performed
  .path('auth/login')
  .post({ 'user': 'username', 'pass': 'password123' }, function(result, next){
    //Do something with result.body, remember to call next at the end
  }) //Expects 200, will pass an object as a json request body, will call function on success
  .put(function(result, next){
    //Do something with 404 result, remember to call next at the end
  }, 404) //Sends empty PUT request to http://localhost.com:3000/api/auth/login and expects 404
  .run(done);
  

TODO :)

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago