Merge branch 'master' into jenkins_test_reports

This commit is contained in:
murgatroid99 2017-09-19 12:26:54 -07:00
commit b2583e561a
2 changed files with 7 additions and 0 deletions

View File

@ -912,6 +912,9 @@ exports.makeClientConstructor = function(methods, serviceName,
}
// Associate all provided attributes with the method
_.assign(ServiceClient.prototype[name], attrs);
if (attrs.originalName) {
ServiceClient.prototype[attrs.originalName] = ServiceClient.prototype[name];
}
});
ServiceClient.service = methods;

View File

@ -215,6 +215,10 @@ describe('Client constructor building', function() {
grpc.makeGenericClientConstructor(illegal_service_attrs);
}, /\$/);
});
it('Should add aliases for original names', function() {
var Client = grpc.makeGenericClientConstructor(mathServiceAttrs);
assert.strictEqual(Client.prototype.add, Client.prototype.Add);
});
});
describe('waitForClientReady', function() {
var server;