Finished fixing the tests

pull/234/head
murgatroid99 10 years ago
parent 0ced264c8c
commit 29c551344d
  1. 14
      src/node/test/client_server_test.js

@ -99,6 +99,7 @@ function stringSerialize(value) {
* @return {string} The string value of the buffer
*/
function stringDeserialize(buffer) {
return buffer.toString();
}
describe('echo client', function() {
@ -130,10 +131,14 @@ describe('echo client', function() {
stream.end();
var index = 0;
stream.on('data', function(chunk) {
assert.equal(messages[index], chunk.toString());
assert.equal(messages[index], chunk);
index += 1;
});
stream.on('status', function(status) {
assert.equal(status.code, client.status.OK);
});
stream.on('end', function() {
assert.equal(index, messages.length);
done();
});
});
@ -214,11 +219,14 @@ describe('secure echo client', function() {
stream.end();
var index = 0;
stream.on('data', function(chunk) {
assert.equal(messages[index], chunk.toString());
assert.equal(messages[index], chunk);
index += 1;
});
stream.on('status', function(status) {
assert.equal(status.code, client.status.OK);
});
stream.on('end', function() {
server.shutdown();
assert.equal(index, messages.length);
done();
});
});

Loading…
Cancel
Save