diff options
author | David Garcia Quintas <dgq@google.com> | 2016-03-31 09:43:03 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-03-31 09:43:03 -0700 |
commit | 2877d7398e9f6bf815af3f42f21cb4c3d917be2e (patch) | |
tree | 7a08a3e544cf8583d4bb2405bb53e48ebdac5a65 /src/node/test/credentials_test.js | |
parent | 2c73b22885ea07ecd338e71a0baf5cdcfc45605a (diff) | |
parent | 2b9012362ca03181eefaec22238c6100e77bb736 (diff) |
Merge branch 'master' of github.com:grpc/grpc into lb_resolvers
Diffstat (limited to 'src/node/test/credentials_test.js')
-rw-r--r-- | src/node/test/credentials_test.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/node/test/credentials_test.js b/src/node/test/credentials_test.js index 294600c85a..73eadfab2c 100644 --- a/src/node/test/credentials_test.js +++ b/src/node/test/credentials_test.js @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -398,18 +398,20 @@ describe('client credentials', function() { metadataUpdater); }); it('Should update metadata on a unary call', function(done) { - var call = client.unary({}, function(err, data) { - assert.ifError(err); - }, null, {credentials: updater_creds}); + var call = client.unary({}, {credentials: updater_creds}, + function(err, data) { + assert.ifError(err); + }); call.on('metadata', function(metadata) { assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']); done(); }); }); it('should update metadata on a client streaming call', function(done) { - var call = client.clientStream(function(err, data) { - assert.ifError(err); - }, null, {credentials: updater_creds}); + var call = client.clientStream({credentials: updater_creds}, + function(err, data) { + assert.ifError(err); + }); call.on('metadata', function(metadata) { assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']); done(); @@ -417,7 +419,7 @@ describe('client credentials', function() { call.end(); }); it('should update metadata on a server streaming call', function(done) { - var call = client.serverStream({}, null, {credentials: updater_creds}); + var call = client.serverStream({}, {credentials: updater_creds}); call.on('data', function() {}); call.on('metadata', function(metadata) { assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']); @@ -425,7 +427,7 @@ describe('client credentials', function() { }); }); it('should update metadata on a bidi streaming call', function(done) { - var call = client.bidiStream(null, {credentials: updater_creds}); + var call = client.bidiStream({credentials: updater_creds}); call.on('data', function() {}); call.on('metadata', function(metadata) { assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']); @@ -443,9 +445,10 @@ describe('client credentials', function() { altMetadataUpdater); var combined_updater = grpc.credentials.combineCallCredentials( updater_creds, alt_updater_creds); - var call = client.unary({}, function(err, data) { - assert.ifError(err); - }, null, {credentials: combined_updater}); + var call = client.unary({}, {credentials: combined_updater}, + function(err, data) { + assert.ifError(err); + }); call.on('metadata', function(metadata) { assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']); assert.deepEqual(metadata.get('other_plugin_key'), |