Skip to content

Commit

Permalink
test: update assertion for Laravel 10+
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Mar 4, 2024
1 parent ccfa641 commit d74a9e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/Features/Commands/UpdateTsconfigCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@

it('asks for confirmation before running in production', function () {
sandbox(function () {
$isLaravel10OrGreater = version_compare(app()->version(), '10.0.0', '>=');

set_env('production');
this()->artisan('vite:tsconfig')
->expectsConfirmation('Do you really wish to run this command?', 'yes')
->expectsConfirmation(
question: $isLaravel10OrGreater
? 'Are you sure you want to run this command?'
: 'Do you really wish to run this command?',
answer: 'yes'
)
->assertExitCode(0);

expect(File::exists(base_path('tsconfig.json')))->toBeTrue();
Expand Down

0 comments on commit d74a9e8

Please sign in to comment.