diff options
author | murgatroid99 <mlumish@google.com> | 2015-05-19 09:51:26 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2015-05-19 09:51:26 -0700 |
commit | 04589a7e0cbdb22c3fe10d2a1e2b7e698091f10d (patch) | |
tree | 44532f408aa0e1f48d38b9ba5355f9d468a00f0b /src/node/test/surface_test.js | |
parent | 778c61b6fc083a951cfa6a939fe04ce8baa656d9 (diff) |
Fixed server to handle invalid arguments without breaking
Diffstat (limited to 'src/node/test/surface_test.js')
-rw-r--r-- | src/node/test/surface_test.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js index ccced741ab..b390f8b2a5 100644 --- a/src/node/test/surface_test.js +++ b/src/node/test/surface_test.js @@ -192,7 +192,6 @@ describe('Other conditions', function() { TestService: { unary: function(call, cb) { var req = call.request; - debugger; if (req.error) { cb(new Error('Requested error'), null, {metadata: ['yes']}); } else { @@ -297,7 +296,7 @@ describe('Other conditions', function() { misbehavingClient = new Client('localhost:' + port); }); it('should respond correctly to a unary call', function(done) { - var call = misbehavingClient.unary(badArg, function(err, data) { + misbehavingClient.unary(badArg, function(err, data) { assert(err); assert.strictEqual(err.code, grpc.status.INVALID_ARGUMENT); done(); @@ -310,11 +309,13 @@ describe('Other conditions', function() { done(); }); call.write(badArg); + // TODO(mlumish): Remove call.end() + call.end(); }); it('should respond correctly to a server stream', function(done) { var call = misbehavingClient.serverStream(badArg); call.on('data', function(data) { - assert.fail(data, null, 'Unexpected data', '!='); + assert.fail(data, null, 'Unexpected data', '==='); }); call.on('error', function(err) { assert.strictEqual(err.code, grpc.status.INVALID_ARGUMENT); @@ -324,13 +325,15 @@ describe('Other conditions', function() { it('should respond correctly to a bidi stream', function(done) { var call = misbehavingClient.bidiStream(); call.on('data', function(data) { - assert.fail(data, null, 'Unexpected data', '!='); + assert.fail(data, null, 'Unexpected data', '==='); }); call.on('error', function(err) { assert.strictEqual(err.code, grpc.status.INVALID_ARGUMENT); done(); }); call.write(badArg); + // TODO(mlumish): Remove call.end() + call.end(); }); }); describe('Trailing metadata', function() { |