Skip to content

Commit

Permalink
test - check logic upstream 2
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinLawrenceMS committed Dec 18, 2024
1 parent 2d95501 commit a5109e6
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions tests/InitializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
));
}
});

0 comments on commit a5109e6

Please sign in to comment.