Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Framework/Features/BuildTasks/BuildTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public function run(?OutputStyle $output = null): int
$this->printFinishMessage();
} catch (Throwable $exception) {
if ($exception instanceof BuildTaskSkippedException) {
$this->writeln('<bg=yellow>Skipped</>');
$this->writeln("<fg=gray> > {$exception->getMessage()}</>");
$this->write("<bg=yellow>Skipped</>\n");
$this->write("<fg=gray> > {$exception->getMessage()}</>");
} else {
$this->writeln('<error>Failed</error>');
$this->writeln("<error>{$exception->getMessage()}</error>");
$this->write("<error>Failed</error>\n");
$this->write("<error>{$exception->getMessage()}</error>");
}

$this->exitCode = $exception->getCode();
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/BuildTaskUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function testTaskSkipping()
});

$this->assertSame(0, $task->property('exitCode'));
$this->assertSame('<bg=yellow>Skipped</>', $task->buffer[1]);
$this->assertSame('<bg=yellow>Skipped</>', trim($task->buffer[1]));
$this->assertSame('<fg=gray> > Task was skipped</>', $task->buffer[2]);
}

Expand All @@ -206,7 +206,7 @@ public function testTaskSkippingWithCustomMessage()
});

$this->assertSame(0, $task->property('exitCode'));
$this->assertSame('<bg=yellow>Skipped</>', $task->buffer[1]);
$this->assertSame('<bg=yellow>Skipped</>', trim($task->buffer[1]));
$this->assertSame('<fg=gray> > Custom reason</>', $task->buffer[2]);
}

Expand All @@ -221,7 +221,7 @@ public function testExceptionHandling()
$task->run();

$this->assertSame(123, $task->property('exitCode'));
$this->assertSame('<error>Failed</error>', $task->buffer[1]);
$this->assertSame('<error>Failed</error>', trim($task->buffer[1]));
$this->assertSame('<error>Test exception</error>', $task->buffer[2]);
}
}
Expand Down