diff options
Diffstat (limited to 'src/node/test/call_test.js')
-rw-r--r-- | src/node/test/call_test.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js index 942c31ac68..8d0f20b074 100644 --- a/src/node/test/call_test.js +++ b/src/node/test/call_test.js @@ -48,14 +48,17 @@ function getDeadline(timeout_secs) { return deadline; } +var insecureCreds = grpc.Credentials.createInsecure(); + describe('call', function() { var channel; var server; before(function() { server = new grpc.Server(); - var port = server.addHttp2Port('localhost:0'); + var port = server.addHttp2Port('localhost:0', + grpc.ServerCredentials.createInsecure()); server.start(); - channel = new grpc.Channel('localhost:' + port); + channel = new grpc.Channel('localhost:' + port, insecureCreds); }); after(function() { server.shutdown(); @@ -81,8 +84,13 @@ describe('call', function() { new grpc.Call(channel, 'method', 0); }); }); + it('should accept an optional fourth string parameter', function() { + assert.doesNotThrow(function() { + new grpc.Call(channel, 'method', new Date(), 'host_override'); + }); + }); it('should fail with a closed channel', function() { - var local_channel = new grpc.Channel('hostname'); + var local_channel = new grpc.Channel('hostname', insecureCreds); local_channel.close(); assert.throws(function() { new grpc.Call(channel, 'method'); |