aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test/surface_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/test/surface_test.js')
-rw-r--r--src/node/test/surface_test.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js
index 7c2a8d7258..6bb90a2303 100644
--- a/src/node/test/surface_test.js
+++ b/src/node/test/surface_test.js
@@ -133,6 +133,24 @@ describe('Server.prototype.addProtoService', function() {
});
});
});
+describe('Client constructor building', function() {
+ var illegal_service_attrs = {
+ $method : {
+ path: '/illegal/$method',
+ requestStream: false,
+ responseStream: false,
+ requestSerialize: _.identity,
+ requestDeserialize: _.identity,
+ responseSerialize: _.identity,
+ responseDeserialize: _.identity
+ }
+ };
+ it('Should reject method names starting with $', function() {
+ assert.throws(function() {
+ grpc.makeGenericClientConstructor(illegal_service_attrs);
+ }, /\$/);
+ });
+});
describe('Client#$waitForReady', function() {
var server;
var port;
@@ -426,7 +444,7 @@ describe('Other conditions', function() {
server.forceShutdown();
});
it('channel.getTarget should be available', function() {
- assert.strictEqual(typeof client.channel.getTarget(), 'string');
+ assert.strictEqual(typeof client.$channel.getTarget(), 'string');
});
describe('Server recieving bad input', function() {
var misbehavingClient;