Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit fd82904

Browse files
committed
Updated test for the start command
1 parent a2fc559 commit fd82904

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Console/StartWebSocketServer.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,16 @@ protected function startWebSocketServer()
240240

241241
$this->buildServer();
242242

243-
if (! $this->option('test')) {
244-
/* 🛰 Start the server 🛰 */
245-
$this->server->run();
243+
// For testing, just boot up the server, run it
244+
// but exit after the next tick.
245+
if ($this->option('test')) {
246+
$this->loop->futureTick(function () {
247+
$this->loop->stop();
248+
});
246249
}
250+
251+
/* 🛰 Start the server 🛰 */
252+
$this->server->run();
247253
}
248254

249255
/**

0 commit comments

Comments
 (0)