mirror of https://github.com/grpc/grpc-node.git
Fixed lint errors
This commit is contained in:
parent
c16a9bdcee
commit
1b56bf8523
|
|
@ -7,7 +7,7 @@
|
||||||
"immed": true,
|
"immed": true,
|
||||||
"indent": 2,
|
"indent": 2,
|
||||||
"latedef": "nofunc",
|
"latedef": "nofunc",
|
||||||
"maxlen": 100,
|
"maxlen": 80,
|
||||||
"newcap": true,
|
"newcap": true,
|
||||||
"node": true,
|
"node": true,
|
||||||
"noarg": true,
|
"noarg": true,
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"trailing": true,
|
"trailing": true,
|
||||||
"undef": true,
|
"undef": true,
|
||||||
"unused": true,
|
"unused": "vars",
|
||||||
"globals": {
|
"globals": {
|
||||||
/* Mocha-provided globals */
|
/* Mocha-provided globals */
|
||||||
"describe": false,
|
"describe": false,
|
||||||
|
|
@ -25,4 +25,4 @@
|
||||||
"after": false,
|
"after": false,
|
||||||
"afterEach": false
|
"afterEach": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var _ = require('underscore');
|
'use strict';
|
||||||
var ProtoBuf = require('protobufjs');
|
|
||||||
var fs = require('fs');
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
|
|
||||||
var Transform = require('stream').Transform;
|
var Transform = require('stream').Transform;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var grpc = require('..');
|
var grpc = require('..');
|
||||||
var testProto = grpc.load(__dirname + '/../interop/test.proto').grpc.testing;
|
var testProto = grpc.load(__dirname + '/../interop/test.proto').grpc.testing;
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
@ -44,7 +46,6 @@ function runTest(iterations, callback) {
|
||||||
function runIterations(finish) {
|
function runIterations(finish) {
|
||||||
var start = process.hrtime();
|
var start = process.hrtime();
|
||||||
var intervals = [];
|
var intervals = [];
|
||||||
var pending = iterations;
|
|
||||||
function next(i) {
|
function next(i) {
|
||||||
if (i >= iterations) {
|
if (i >= iterations) {
|
||||||
testServer.server.shutdown();
|
testServer.server.shutdown();
|
||||||
|
|
@ -69,28 +70,30 @@ function runTest(iterations, callback) {
|
||||||
|
|
||||||
function warmUp(num) {
|
function warmUp(num) {
|
||||||
var pending = num;
|
var pending = num;
|
||||||
|
function startCall() {
|
||||||
|
client.emptyCall({}, function(err, resp) {
|
||||||
|
pending--;
|
||||||
|
if (pending === 0) {
|
||||||
|
runIterations(callback);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
for (var i = 0; i < num; i++) {
|
for (var i = 0; i < num; i++) {
|
||||||
(function(i) {
|
startCall();
|
||||||
client.emptyCall({}, function(err, resp) {
|
|
||||||
pending--;
|
|
||||||
if (pending === 0) {
|
|
||||||
runIterations(callback);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})(i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
warmUp(100);
|
warmUp(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function percentile(arr, percentile) {
|
function percentile(arr, pct) {
|
||||||
if (percentile > 99) {
|
if (pct > 99) {
|
||||||
percentile = 99;
|
pct = 99;
|
||||||
}
|
}
|
||||||
if (percentile < 0) {
|
if (pct < 0) {
|
||||||
percentile = 0;
|
pct = 0;
|
||||||
}
|
}
|
||||||
return arr[(arr.length * percentile / 100)|0];
|
var index = Math.floor(arr.length * pct / 100);
|
||||||
|
return arr[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
var grpc = require('..');
|
var grpc = require('..');
|
||||||
var examples = grpc.load(__dirname + '/stock.proto').examples;
|
var examples = grpc.load(__dirname + '/stock.proto').examples;
|
||||||
|
|
|
||||||
2
index.js
2
index.js
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
||||||
var ProtoBuf = require('protobufjs');
|
var ProtoBuf = require('protobufjs');
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var grpc = require('..');
|
var grpc = require('..');
|
||||||
|
|
@ -41,7 +43,8 @@ var assert = require('assert');
|
||||||
|
|
||||||
var AUTH_SCOPE = 'https://www.googleapis.com/auth/xapi.zoo';
|
var AUTH_SCOPE = 'https://www.googleapis.com/auth/xapi.zoo';
|
||||||
var AUTH_SCOPE_RESPONSE = 'xapi.zoo';
|
var AUTH_SCOPE_RESPONSE = 'xapi.zoo';
|
||||||
var AUTH_USER = '155450119199-3psnrh1sdr3d8cpj1v46naggf81mhdnk@developer.gserviceaccount.com';
|
var AUTH_USER = ('155450119199-3psnrh1sdr3d8cpj1v46naggf81mhdnk' +
|
||||||
|
'@developer.gserviceaccount.com');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a buffer filled with size zeroes
|
* Create a buffer filled with size zeroes
|
||||||
|
|
@ -318,7 +321,7 @@ var test_cases = {
|
||||||
/**
|
/**
|
||||||
* Execute a single test case.
|
* Execute a single test case.
|
||||||
* @param {string} address The address of the server to connect to, in the
|
* @param {string} address The address of the server to connect to, in the
|
||||||
* format "hostname:port"
|
* format 'hostname:port'
|
||||||
* @param {string} host_overrirde The hostname of the server to use as an SSL
|
* @param {string} host_overrirde The hostname of the server to use as an SSL
|
||||||
* override
|
* override
|
||||||
* @param {string} test_case The name of the test case to run
|
* @param {string} test_case The name of the test case to run
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"description": "gRPC Library for Node",
|
"description": "gRPC Library for Node",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "jshint src test examples interop index.js",
|
"lint": "jshint src test examples interop index.js",
|
||||||
"test": "./node_modules/mocha/bin/mocha"
|
"test": "./node_modules/mocha/bin/mocha && npm run-script lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bindings": "^1.2.1",
|
"bindings": "^1.2.1",
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
||||||
var capitalize = require('underscore.string/capitalize');
|
var capitalize = require('underscore.string/capitalize');
|
||||||
|
|
@ -77,6 +79,7 @@ function ClientWritableStream(call, serialize) {
|
||||||
* @param {function(Error=)} callback Called when the write is complete
|
* @param {function(Error=)} callback Called when the write is complete
|
||||||
*/
|
*/
|
||||||
function _write(chunk, encoding, callback) {
|
function _write(chunk, encoding, callback) {
|
||||||
|
/* jshint validthis: true */
|
||||||
var batch = {};
|
var batch = {};
|
||||||
batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk);
|
batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk);
|
||||||
this.call.startBatch(batch, function(err, event) {
|
this.call.startBatch(batch, function(err, event) {
|
||||||
|
|
@ -85,7 +88,7 @@ function _write(chunk, encoding, callback) {
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
ClientWritableStream.prototype._write = _write;
|
ClientWritableStream.prototype._write = _write;
|
||||||
|
|
||||||
|
|
@ -111,6 +114,7 @@ function ClientReadableStream(call, deserialize) {
|
||||||
* @param {*} size Ignored because we use objectMode=true
|
* @param {*} size Ignored because we use objectMode=true
|
||||||
*/
|
*/
|
||||||
function _read(size) {
|
function _read(size) {
|
||||||
|
/* jshint validthis: true */
|
||||||
var self = this;
|
var self = this;
|
||||||
/**
|
/**
|
||||||
* Callback to be called when a READ event is received. Pushes the data onto
|
* Callback to be called when a READ event is received. Pushes the data onto
|
||||||
|
|
@ -126,7 +130,7 @@ function _read(size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var data = event.read;
|
var data = event.read;
|
||||||
if (self.push(self.deserialize(data)) && data != null) {
|
if (self.push(self.deserialize(data)) && data !== null) {
|
||||||
var read_batch = {};
|
var read_batch = {};
|
||||||
read_batch[grpc.opType.RECV_MESSAGE] = true;
|
read_batch[grpc.opType.RECV_MESSAGE] = true;
|
||||||
self.call.startBatch(read_batch, readCallback);
|
self.call.startBatch(read_batch, readCallback);
|
||||||
|
|
@ -144,7 +148,7 @@ function _read(size) {
|
||||||
self.call.startBatch(read_batch, readCallback);
|
self.call.startBatch(read_batch, readCallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
ClientReadableStream.prototype._read = _read;
|
ClientReadableStream.prototype._read = _read;
|
||||||
|
|
||||||
|
|
@ -163,10 +167,6 @@ function ClientDuplexStream(call, serialize, deserialize) {
|
||||||
Duplex.call(this, {objectMode: true});
|
Duplex.call(this, {objectMode: true});
|
||||||
this.serialize = common.wrapIgnoreNull(serialize);
|
this.serialize = common.wrapIgnoreNull(serialize);
|
||||||
this.deserialize = common.wrapIgnoreNull(deserialize);
|
this.deserialize = common.wrapIgnoreNull(deserialize);
|
||||||
var self = this;
|
|
||||||
var finished = false;
|
|
||||||
// Indicates that a read is currently pending
|
|
||||||
var reading = false;
|
|
||||||
this.call = call;
|
this.call = call;
|
||||||
this.on('finish', function() {
|
this.on('finish', function() {
|
||||||
var batch = {};
|
var batch = {};
|
||||||
|
|
@ -182,6 +182,7 @@ ClientDuplexStream.prototype._write = _write;
|
||||||
* Cancel the ongoing call
|
* Cancel the ongoing call
|
||||||
*/
|
*/
|
||||||
function cancel() {
|
function cancel() {
|
||||||
|
/* jshint validthis: true */
|
||||||
this.call.cancel();
|
this.call.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,6 +214,7 @@ function makeUnaryRequestFunction(method, serialize, deserialize) {
|
||||||
* @return {EventEmitter} An event emitter for stream related events
|
* @return {EventEmitter} An event emitter for stream related events
|
||||||
*/
|
*/
|
||||||
function makeUnaryRequest(argument, callback, metadata, deadline) {
|
function makeUnaryRequest(argument, callback, metadata, deadline) {
|
||||||
|
/* jshint validthis: true */
|
||||||
if (deadline === undefined) {
|
if (deadline === undefined) {
|
||||||
deadline = Infinity;
|
deadline = Infinity;
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +244,7 @@ function makeUnaryRequestFunction(method, serialize, deserialize) {
|
||||||
callback(err);
|
callback(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (response.status.code != grpc.status.OK) {
|
if (response.status.code !== grpc.status.OK) {
|
||||||
callback(response.status);
|
callback(response.status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -278,6 +280,7 @@ function makeClientStreamRequestFunction(method, serialize, deserialize) {
|
||||||
* @return {EventEmitter} An event emitter for stream related events
|
* @return {EventEmitter} An event emitter for stream related events
|
||||||
*/
|
*/
|
||||||
function makeClientStreamRequest(callback, metadata, deadline) {
|
function makeClientStreamRequest(callback, metadata, deadline) {
|
||||||
|
/* jshint validthis: true */
|
||||||
if (deadline === undefined) {
|
if (deadline === undefined) {
|
||||||
deadline = Infinity;
|
deadline = Infinity;
|
||||||
}
|
}
|
||||||
|
|
@ -310,7 +313,7 @@ function makeClientStreamRequestFunction(method, serialize, deserialize) {
|
||||||
callback(err);
|
callback(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (response.status.code != grpc.status.OK) {
|
if (response.status.code !== grpc.status.OK) {
|
||||||
callback(response.status);
|
callback(response.status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -345,6 +348,7 @@ function makeServerStreamRequestFunction(method, serialize, deserialize) {
|
||||||
* @return {EventEmitter} An event emitter for stream related events
|
* @return {EventEmitter} An event emitter for stream related events
|
||||||
*/
|
*/
|
||||||
function makeServerStreamRequest(argument, metadata, deadline) {
|
function makeServerStreamRequest(argument, metadata, deadline) {
|
||||||
|
/* jshint validthis: true */
|
||||||
if (deadline === undefined) {
|
if (deadline === undefined) {
|
||||||
deadline = Infinity;
|
deadline = Infinity;
|
||||||
}
|
}
|
||||||
|
|
@ -404,6 +408,7 @@ function makeBidiStreamRequestFunction(method, serialize, deserialize) {
|
||||||
* @return {EventEmitter} An event emitter for stream related events
|
* @return {EventEmitter} An event emitter for stream related events
|
||||||
*/
|
*/
|
||||||
function makeBidiStreamRequest(metadata, deadline) {
|
function makeBidiStreamRequest(metadata, deadline) {
|
||||||
|
/* jshint validthis: true */
|
||||||
if (deadline === undefined) {
|
if (deadline === undefined) {
|
||||||
deadline = Infinity;
|
deadline = Infinity;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
||||||
var capitalize = require('underscore.string/capitalize');
|
var capitalize = require('underscore.string/capitalize');
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
||||||
var capitalize = require('underscore.string/capitalize');
|
var capitalize = require('underscore.string/capitalize');
|
||||||
|
|
@ -217,6 +219,7 @@ function ServerWritableStream(call, serialize) {
|
||||||
* complete
|
* complete
|
||||||
*/
|
*/
|
||||||
function _write(chunk, encoding, callback) {
|
function _write(chunk, encoding, callback) {
|
||||||
|
/* jshint validthis: true */
|
||||||
var batch = {};
|
var batch = {};
|
||||||
batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk);
|
batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk);
|
||||||
this.call.startBatch(batch, function(err, value) {
|
this.call.startBatch(batch, function(err, value) {
|
||||||
|
|
@ -251,6 +254,7 @@ function ServerReadableStream(call, deserialize) {
|
||||||
* @param {number} size Ignored
|
* @param {number} size Ignored
|
||||||
*/
|
*/
|
||||||
function _read(size) {
|
function _read(size) {
|
||||||
|
/* jshint validthis: true */
|
||||||
var self = this;
|
var self = this;
|
||||||
/**
|
/**
|
||||||
* Callback to be called when a READ event is received. Pushes the data onto
|
* Callback to be called when a READ event is received. Pushes the data onto
|
||||||
|
|
@ -267,7 +271,7 @@ function _read(size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var data = event.read;
|
var data = event.read;
|
||||||
if (self.push(self.deserialize(data)) && data != null) {
|
if (self.push(self.deserialize(data)) && data !== null) {
|
||||||
var read_batch = {};
|
var read_batch = {};
|
||||||
read_batch[grpc.opType.RECV_MESSAGE] = true;
|
read_batch[grpc.opType.RECV_MESSAGE] = true;
|
||||||
self.call.startBatch(read_batch, readCallback);
|
self.call.startBatch(read_batch, readCallback);
|
||||||
|
|
@ -424,7 +428,6 @@ function Server(getMetadata, options) {
|
||||||
var handlers = this.handlers;
|
var handlers = this.handlers;
|
||||||
var server = new grpc.Server(options);
|
var server = new grpc.Server(options);
|
||||||
this._server = server;
|
this._server = server;
|
||||||
var started = false;
|
|
||||||
/**
|
/**
|
||||||
* Start the server and begin handling requests
|
* Start the server and begin handling requests
|
||||||
* @this Server
|
* @this Server
|
||||||
|
|
@ -456,8 +459,7 @@ function Server(getMetadata, options) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
server.requestCall(handleNewCall);
|
server.requestCall(handleNewCall);
|
||||||
var handler = undefined;
|
var handler;
|
||||||
var deadline = details.deadline;
|
|
||||||
if (handlers.hasOwnProperty(method)) {
|
if (handlers.hasOwnProperty(method)) {
|
||||||
handler = handlers[method];
|
handler = handlers[method];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -465,7 +467,7 @@ function Server(getMetadata, options) {
|
||||||
batch[grpc.opType.SEND_INITIAL_METADATA] = {};
|
batch[grpc.opType.SEND_INITIAL_METADATA] = {};
|
||||||
batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
|
batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
|
||||||
code: grpc.status.UNIMPLEMENTED,
|
code: grpc.status.UNIMPLEMENTED,
|
||||||
details: "This method is not available on this server.",
|
details: 'This method is not available on this server.',
|
||||||
metadata: {}
|
metadata: {}
|
||||||
};
|
};
|
||||||
batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
|
batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var grpc = require('bindings')('grpc.node');
|
var grpc = require('bindings')('grpc.node');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var grpc = require('bindings')('grpc.node');
|
var grpc = require('bindings')('grpc.node');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var grpc = require('bindings')('grpc.node');
|
var grpc = require('bindings')('grpc.node');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var grpc = require('bindings')('grpc.node');
|
var grpc = require('bindings')('grpc.node');
|
||||||
|
|
||||||
|
|
@ -227,7 +229,7 @@ describe('end-to-end', function() {
|
||||||
response_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
|
response_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
|
||||||
server_call.startBatch(response_batch, function(err, response) {
|
server_call.startBatch(response_batch, function(err, response) {
|
||||||
assert(response['send status']);
|
assert(response['send status']);
|
||||||
assert(!response['cancelled']);
|
assert(!response.cancelled);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var interop_server = require('../interop/interop_server.js');
|
var interop_server = require('../interop/interop_server.js');
|
||||||
var interop_client = require('../interop/interop_client.js');
|
var interop_client = require('../interop/interop_client.js');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
|
|
||||||
var grpc = require('..');
|
var grpc = require('..');
|
||||||
|
|
@ -59,7 +61,7 @@ describe('Math client', function() {
|
||||||
});
|
});
|
||||||
it('should handle a single request', function(done) {
|
it('should handle a single request', function(done) {
|
||||||
var arg = {dividend: 7, divisor: 4};
|
var arg = {dividend: 7, divisor: 4};
|
||||||
var call = math_client.div(arg, function handleDivResult(err, value) {
|
math_client.div(arg, function handleDivResult(err, value) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.equal(value.quotient, 1);
|
assert.equal(value.quotient, 1);
|
||||||
assert.equal(value.remainder, 3);
|
assert.equal(value.remainder, 3);
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var assert = require('assert');
|
'use strict';
|
||||||
|
|
||||||
var surface_server = require('../src/server.js');
|
var assert = require('assert');
|
||||||
|
|
||||||
var surface_client = require('../src/client.js');
|
var surface_client = require('../src/client.js');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue