|
@@ -1334,14 +1334,14 @@ describe('Cancelling surface client', function() {
|
|
});
|
|
});
|
|
it('Should correctly cancel a unary call', function(done) {
|
|
it('Should correctly cancel a unary call', function(done) {
|
|
var call = client.div({'divisor': 0, 'dividend': 0}, function(err, resp) {
|
|
var call = client.div({'divisor': 0, 'dividend': 0}, function(err, resp) {
|
|
- assert.strictEqual(err.code, surface_client.status.CANCELLED);
|
|
|
|
|
|
+ assert.strictEqual(err.code, grpc.status.CANCELLED);
|
|
done();
|
|
done();
|
|
});
|
|
});
|
|
call.cancel();
|
|
call.cancel();
|
|
});
|
|
});
|
|
it('Should correctly cancel a client stream call', function(done) {
|
|
it('Should correctly cancel a client stream call', function(done) {
|
|
var call = client.sum(function(err, resp) {
|
|
var call = client.sum(function(err, resp) {
|
|
- assert.strictEqual(err.code, surface_client.status.CANCELLED);
|
|
|
|
|
|
+ assert.strictEqual(err.code, grpc.status.CANCELLED);
|
|
done();
|
|
done();
|
|
});
|
|
});
|
|
call.cancel();
|
|
call.cancel();
|
|
@@ -1350,7 +1350,7 @@ describe('Cancelling surface client', function() {
|
|
var call = client.fib({'limit': 5});
|
|
var call = client.fib({'limit': 5});
|
|
call.on('data', function() {});
|
|
call.on('data', function() {});
|
|
call.on('error', function(error) {
|
|
call.on('error', function(error) {
|
|
- assert.strictEqual(error.code, surface_client.status.CANCELLED);
|
|
|
|
|
|
+ assert.strictEqual(error.code, grpc.status.CANCELLED);
|
|
done();
|
|
done();
|
|
});
|
|
});
|
|
call.cancel();
|
|
call.cancel();
|
|
@@ -1359,14 +1359,14 @@ describe('Cancelling surface client', function() {
|
|
var call = client.divMany();
|
|
var call = client.divMany();
|
|
call.on('data', function() {});
|
|
call.on('data', function() {});
|
|
call.on('error', function(error) {
|
|
call.on('error', function(error) {
|
|
- assert.strictEqual(error.code, surface_client.status.CANCELLED);
|
|
|
|
|
|
+ assert.strictEqual(error.code, grpc.status.CANCELLED);
|
|
done();
|
|
done();
|
|
});
|
|
});
|
|
call.cancel();
|
|
call.cancel();
|
|
});
|
|
});
|
|
it('Should be idempotent', function(done) {
|
|
it('Should be idempotent', function(done) {
|
|
var call = client.div({'divisor': 0, 'dividend': 0}, function(err, resp) {
|
|
var call = client.div({'divisor': 0, 'dividend': 0}, function(err, resp) {
|
|
- assert.strictEqual(err.code, surface_client.status.CANCELLED);
|
|
|
|
|
|
+ assert.strictEqual(err.code, grpc.status.CANCELLED);
|
|
// Call asynchronously to try cancelling after call is fully completed
|
|
// Call asynchronously to try cancelling after call is fully completed
|
|
setImmediate(function() {
|
|
setImmediate(function() {
|
|
assert.doesNotThrow(function() {
|
|
assert.doesNotThrow(function() {
|