From 7c34bb34ce6fc7eb73bfe88aebabf1a5bf7d67c7 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Thu, 24 Jul 2014 23:22:52 +0300 Subject: [PATCH] Exit should wait for stdout (joyent/node#1669). --- test/run.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/run.js b/test/run.js index 59d4abce7f..84e7363a65 100644 --- a/test/run.js +++ b/test/run.js @@ -13,8 +13,11 @@ driver.runTests(report); console.log(testsRun + " tests run in " + (+new Date - t0) + "ms"); if (failed) { - console.log(failed + " failures."); - process.exit(1); -} + process.stdout.once('drain', function () { + process.exit(1); + }); -console.log("All passed."); + console.log(failed + " failures."); +} else { + console.log("All passed."); +}