Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Commit

Permalink
add a test for http request made if rpc server is down
Browse files Browse the repository at this point in the history
  • Loading branch information
dughibot committed Oct 21, 2015
1 parent 8dd6ae5 commit b945e0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,13 @@ exports.invalidHttp = function(test) {
server.close(test.done.bind(test));
});
};

exports.serverDownHttp = function(test) {
test.expect(1);
var jsonRpcClient = new JSONRPCclient(new HttpTransport('localhost', 23232));
jsonRpcClient.register('foo');
jsonRpcClient.foo('bar', function(err) {
test.ok(err instanceof Error, 'received the error response from the client library');
test.done();
});
};

0 comments on commit b945e0f

Please sign in to comment.