Permalink
Browse files

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 :)
  • Loading branch information...
Juan Ignacio Iglesias
Juan Ignacio Iglesias committed Oct 29, 2011
1 parent b5e3cb0 commit ec2da8ab2020efa6b20865dbc3767141d62614dc
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/expresso
View
@@ -791,6 +791,10 @@ function runFiles(files) {
(function next() {
if (files.length) {
runFile(files.shift(), next);
+ } else {
+ setTimeout(function() {

This comment has been minimized.

Show comment Hide comment
@ignacioiglesias

ignacioiglesias Oct 30, 2011

Owner

process.nextTick can (should?) be used instead of setTimeout. Sorry about that :/

@ignacioiglesias

ignacioiglesias Oct 30, 2011

Owner

process.nextTick can (should?) be used instead of setTimeout. Sorry about that :/

+ process.exit(0);
+ }, 0);
}
})();
} else {

0 comments on commit ec2da8a

Please sign in to comment.