From 8de7c099f65dfe216850f251efbe8d8396a16959 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 1 Aug 2017 10:41:52 -0700 Subject: [PATCH] Split tests more granularly --- src/node/test/call_test.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js index e19f47beb98..b5246c4f31a 100644 --- a/src/node/test/call_test.js +++ b/src/node/test/call_test.js @@ -189,18 +189,24 @@ describe('call', function() { }); }); describe('startBatch with message', function() { - it('should fail with non-buffer arguments', function() { + it('should fail with null argument', function() { var call = new grpc.Call(channel, 'method', getDeadline(1)); assert.throws(function() { var batch = {}; batch[grpc.opType.SEND_MESSAGE] = null; call.startBatch(batch, function(){}); }, TypeError); + }); + it('should fail with numeric argument', function() { + var call = new grpc.Call(channel, 'method', getDeadline(1)); assert.throws(function() { var batch = {}; batch[grpc.opType.SEND_MESSAGE] = 5; call.startBatch(batch, function(){}); }, TypeError); + }); + it('should fail with string argument', function() { + var call = new grpc.Call(channel, 'method', getDeadline(1)); assert.throws(function() { var batch = {}; batch[grpc.opType.SEND_MESSAGE] = 'value'; @@ -242,7 +248,7 @@ describe('call', function() { call.startBatch(batch, function(){}); }, TypeError); }); - it('should fail with incorrectly typed arguments', function() { + it('should fail with incorrectly typed code argument', function() { var call = new grpc.Call(channel, 'method', getDeadline(1)); assert.throws(function() { var batch = {}; @@ -253,6 +259,9 @@ describe('call', function() { }; call.startBatch(batch, function(){}); }, TypeError); + }); + it('should fail with incorrectly typed details argument', function() { + var call = new grpc.Call(channel, 'method', getDeadline(1)); assert.throws(function() { var batch = {}; batch[grpc.opType.SEND_STATUS_FROM_SERVER] = { @@ -262,6 +271,9 @@ describe('call', function() { }; call.startBatch(batch, function(){}); }, TypeError); + }); + it('should fail with incorrectly typed metadata argument', function() { + var call = new grpc.Call(channel, 'method', getDeadline(1)); assert.throws(function() { var batch = {}; batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {