Skip to content

Commit

Permalink
fix: output for tool command to also contain error output (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
stickeepaul authored Jan 3, 2023
1 parent 5895fe7 commit ef9585d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/Commands/ToolCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ private function process(array $command): array
}
} else {
$taskSuccess = true;
$output = $process->getOutput();
$output = $process->getErrorOutput();
$output .= $process->getOutput();
}

$this->newLine();
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/FixCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

it('works', function () {
$this->artisan('fix')
->expectsOutputToContain('Fixed all files')
->expectsOutputToContain('stickee')
->assertExitCode(0);
});

it('allows passing options', function () {
$this->artisan('fix --dry-run')
->expectsOutputToContain('Checked all files')
$this->artisan('fix -- --dry-run --verbose')
->expectsOutputToContain('Legend:')
->assertExitCode(0);
});

0 comments on commit ef9585d

Please sign in to comment.