Split tests more granularly

pull/12003/head
murgatroid99 8 years ago
parent 23b74dcced
commit 8de7c099f6
  1. 16
      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] = {

Loading…
Cancel
Save