aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test/credentials_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/test/credentials_test.js')
-rw-r--r--src/node/test/credentials_test.js27
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'),