From a5109e6c515c91537e7c83583c4d6f28c9de4721 Mon Sep 17 00:00:00 2001 From: JustinLawrenceMS Date: Wed, 18 Dec 2024 17:42:56 -0600 Subject: [PATCH] test - check logic upstream 2 --- tests/InitializationTest.php | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/InitializationTest.php b/tests/InitializationTest.php index e0f4e45..a2cf8d9 100644 --- a/tests/InitializationTest.php +++ b/tests/InitializationTest.php @@ -3,41 +3,41 @@ use PHPUnit\Framework\ExpectationFailedException; use function Orchestra\Testbench\remote; -test('critical feature', function () { +it('has the sauce', function () { stopIfConditionFails(!is_null('This is not null.'), 'Required condition is missing. Stopping tests.'); +}); + +it('can boot up the app', function () { + $output = ''; - it('can boot up the app', function () { - $output = ''; - - $process = remote('native:serve --no-dependencies --no-interaction'); - $process->start(function ($type, $line) use (&$output) { - $output .= $line; - }); + $process = remote('native:serve --no-dependencies --no-interaction'); + $process->start(function ($type, $line) use (&$output) { + $output .= $line; + }); - try { - retry(20, function () use ($output) { - // Wait until port 8100 is open - dump('Waiting for port 8100 to open...'); + try { + retry(20, function () use ($output) { + // Wait until port 8100 is open + dump('Waiting for port 8100 to open...'); - $fp = @fsockopen('localhost', 8100, $errno, $errstr, 1); - if ($fp === false) { - throw new Exception(sprintf( - 'Port 8100 is not open yet. Output: "%s"', - $output, - )); - } - }, 5000); - } finally { - $process->stop(); - } + $fp = @fsockopen('localhost', 8100, $errno, $errstr, 1); + if ($fp === false) { + throw new Exception(sprintf( + 'Port 8100 is not open yet. Output: "%s"', + $output, + )); + } + }, 5000); + } finally { + $process->stop(); + } - try { - expect($output)->toContain('Running the dev script with npm'); - } catch (ExpectationFailedException) { - throw new ExpectationFailedException(sprintf( - '"%s" does not match the expected output.', - $output, - )); - } - }); -}); + try { + expect($output)->toContain('Running the dev script with npm'); + } catch (ExpectationFailedException) { + throw new ExpectationFailedException(sprintf( + '"%s" does not match the expected output.', + $output, + )); + } +}); \ No newline at end of file