From ec2da8ab2020efa6b20865dbc3767141d62614dc Mon Sep 17 00:00:00 2001 From: Juan Ignacio Iglesias Date: Sat, 29 Oct 2011 10:44:52 -0300 Subject: [PATCH 1/2] Fixes having to hit CTRL + C when doing serial tests. I was doing some tests using Socket.io and even though everything ran okay except that I had to manually exit Expresso using ctrl + c. I tried using `process.exit` inside the `else` block but that would cause Expresso to output `Failure: Only 1 of 3 suites have been started`. Using a timeout seems to fix it despite the fact that I'm using 0 as time. Not really sure how this works, but it does :) --- bin/expresso | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/expresso b/bin/expresso index fdad22c..47cb99a 100755 --- a/bin/expresso +++ b/bin/expresso @@ -791,6 +791,10 @@ function runFiles(files) { (function next() { if (files.length) { runFile(files.shift(), next); + } else { + setTimeout(function() { + process.exit(0); + }, 0); } })(); } else { From 2156ecd07a0a76e9db46018990598f291f6d9c00 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Iglesias Date: Sun, 30 Oct 2011 00:17:17 -0300 Subject: [PATCH 2/2] Replaced setTimeout with process.nextTick --- bin/expresso | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/expresso b/bin/expresso index 47cb99a..a17625c 100755 --- a/bin/expresso +++ b/bin/expresso @@ -792,9 +792,9 @@ function runFiles(files) { if (files.length) { runFile(files.shift(), next); } else { - setTimeout(function() { + process.nextTick(function() { process.exit(0); - }, 0); + }); } })(); } else {