diff --git a/packages/framework/tests/Feature/Commands/ServeCommandTest.php b/packages/framework/tests/Feature/Commands/ServeCommandTest.php index 0e9c07b313a..1cdd93ce359 100644 --- a/packages/framework/tests/Feature/Commands/ServeCommandTest.php +++ b/packages/framework/tests/Feature/Commands/ServeCommandTest.php @@ -262,52 +262,6 @@ public function testHydeServeCommandWithViteOptionButViteNotRunning() ->assertExitCode(0); } - public function testHydeServeCommandProcessLoopWithViteOptionAndViteOutput() - { - $mockViteProcess = mock(InvokedProcess::class); - $mockViteProcess->shouldReceive('running') - ->times(2) - ->andReturn(true, false); - $mockViteProcess->shouldReceive('latestOutput') - ->once() - ->andReturn('vite latest output'); - - $mockServerProcess = mock(InvokedProcess::class); - $mockServerProcess->shouldReceive('running') - ->times(2) - ->andReturn(true, false); - - Process::shouldReceive('forever') - ->twice() - ->withNoArgs() - ->andReturnSelf(); - - Process::shouldReceive('env') - ->once() - ->with(['HYDE_SERVER_REQUEST_OUTPUT' => false, 'HYDE_SERVER_VITE' => 'enabled']) - ->andReturnSelf(); - - Process::shouldReceive('start') - ->once() - ->with('npm run dev') - ->andReturn($mockViteProcess); - - Process::shouldReceive('start') - ->once() - ->withArgs(function (string $command, Closure $handle) { - $handle('stdout', 'vite latest output'); - return $command === "php -S localhost:8080 {$this->binaryPath()}"; - }) - ->andReturn($mockServerProcess); - - Sleep::fake(); - - $this->artisan('serve --no-ansi --vite') - ->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop') - ->expectsOutput('vite latest output') - ->assertExitCode(0); - } - protected function binaryPath(): string { return Hyde::path('vendor/hyde/realtime-compiler/bin/server.php');