Skip to content

Commit

Permalink
[fix test] Make test runner exit after test exits
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Dec 18, 2011
1 parent 87999d0 commit 31a8c68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/core/run
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
//

var path = require('path'),
spawn = require('child_process').spawn,
httpProxy = require('../../'),
common = require('./common');

Expand All @@ -50,7 +51,11 @@ var proxy = httpProxy.createServer(common.PORT, 'localhost');
proxy.listen(common.PROXY_PORT);

proxy.on('listening', function () {
require(path.join(process.cwd(), process.argv[2]));
console.log('Proxy server listening on ' + common.PROXY_PORT);
var testProcess = spawn(process.argv[0], [ process.argv[2] ]);
testProcess.stdout.pipe(process.stdout);
testProcess.stderr.pipe(process.stderr);
testProcess.on('exit', process.exit);
});

// vim:filetype=javascript
Expand Down

0 comments on commit 31a8c68

Please sign in to comment.