updated the keepalive test so that it uses IPC instead of output parsing.

This commit is contained in:
Spencer Alger
2014-03-27 10:41:01 -07:00
parent 4ab22a1a61
commit 6ca5453195
2 changed files with 37 additions and 36 deletions

View File

@ -376,18 +376,16 @@ describe('Http Connector', function () {
var path = require('path');
var es = require('event-stream');
var proc = cp.spawn('node', [path.join(__dirname, '../../fixtures/keepalive.js')], {
silent: true
});
var proc = cp.fork(path.join(__dirname, '../../fixtures/keepalive.js'));
proc.on('message', function (output) {
proc.kill();
expect(output).to.have.property('remaining', 0);
expect(output).to.have.property('timeouts', 0);
es.merge(
proc.stdout,
proc.stderr
).pipe(es.wait(function (err, output) {
expect(err).to.eql(null);
expect(parseInt(output.trim(), 10) <= 1).to.be.ok();
done();
}));
});
});
it('properly removes all elements from the socket', function () {