Skip to content

Commit 715acc9

Browse files
committed
Update console output
1 parent 2995648 commit 715acc9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Console/DeployCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
public function handle(): int
4444
{
4545
if (! $this->token) {
46-
$this->error('No NIGHTWATCH_TOKEN environment variable configured.');
46+
$this->components->error('No NIGHTWATCH_TOKEN environment variable configured.');
4747

4848
return 1;
4949
}
@@ -66,17 +66,17 @@ public function handle(): int
6666
])
6767
->throw();
6868

69-
$this->info('Deployment successful');
69+
$this->components->info('Deployment sent to Nightwatch successfully.');
7070

7171
return 0;
7272
} catch (RequestException $e) {
7373
$message = Str::limit($e->response->body(), 1000, '[...]');
7474

75-
$this->error("Deployment failed: {$e->getCode()} [{$message}]");
75+
$this->components->error("Deployment could not be sent to Nightwatch: {$e->getCode()} [{$message}]");
7676

7777
return 1;
7878
} catch (Throwable $e) {
79-
$this->error("Deployment failed: [{$e->getMessage()}]");
79+
$this->components->error("Deployment could not be sent to Nightwatch: [{$e->getMessage()}]");
8080

8181
return 1;
8282
}

tests/Feature/Console/DeployCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function test_it_can_run_the_deploy_command(): void
3333
]);
3434

3535
$this->artisan('nightwatch:deploy')
36-
->expectsOutput('Deployment successful')
36+
->expectsOutputToContain('Deployment sent to Nightwatch successfully.')
3737
->assertExitCode(0);
3838
}
3939

@@ -55,7 +55,7 @@ public function test_it_can_run_the_deploy_command_without_a_version(): void
5555
]);
5656

5757
$this->artisan('nightwatch:deploy')
58-
->expectsOutput('Deployment successful')
58+
->expectsOutputToContain('Deployment sent to Nightwatch successfully.')
5959
->assertExitCode(0);
6060
}
6161

@@ -64,7 +64,7 @@ public function test_it_fails_when_the_deploy_command_is_run_without_a_token():
6464
$this->app->singleton(DeployCommand::class, fn () => new DeployCommand(token: null));
6565

6666
$this->artisan('nightwatch:deploy')
67-
->expectsOutput('No NIGHTWATCH_TOKEN environment variable configured.')
67+
->expectsOutputToContain('No NIGHTWATCH_TOKEN environment variable configured.')
6868
->assertExitCode(1);
6969
}
7070

@@ -76,7 +76,7 @@ public function test_it_handles_http_errors(): void
7676
]);
7777

7878
$this->artisan('nightwatch:deploy')
79-
->expectsOutput('Deployment failed: 500 [Whoops!]')
79+
->expectsOutputToContain('Deployment could not be sent to Nightwatch: 500 [Whoops!]')
8080
->assertExitCode(1);
8181
}
8282

@@ -88,7 +88,7 @@ public function test_it_handles_connection_errors(): void
8888
]);
8989

9090
$this->artisan('nightwatch:deploy')
91-
->expectsOutput('Deployment failed: [Whoops!]')
91+
->expectsOutputToContain('Deployment could not be sent to Nightwatch: [Whoops!]')
9292
->assertExitCode(1);
9393
}
9494
}

0 commit comments

Comments
 (0)