Fixed tests by properly half-closing

This commit is contained in:
murgatroid99 2015-01-26 18:20:44 -08:00
parent 2faae54c0b
commit 93facf2c41

View File

@ -127,6 +127,7 @@ describe('echo client', function() {
for (var i = 0; i < messages.length; i++) {
stream.write(messages[i]);
}
stream.end();
var index = 0;
stream.on('data', function(chunk) {
assert.equal(messages[index], chunk.toString());
@ -210,6 +211,7 @@ describe('secure echo client', function() {
for (var i = 0; i < messages.length; i++) {
stream.write(messages[i]);
}
stream.end();
var index = 0;
stream.on('data', function(chunk) {
assert.equal(messages[index], chunk.toString());