Skip to content

Commit

Permalink
Test skipped tasks have exit code 3
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 28, 2024
1 parent 70291fb commit d90dcc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testSitemapIsNotGeneratedWhenConditionsAreNotMet()
->expectsOutputToContain('Generating sitemap...')
->expectsOutputToContain('Skipped')
->expectsOutput(' > Cannot generate sitemap without a valid base URL')
->assertExitCode(0);
->assertExitCode(3);

$this->assertFileDoesNotExist(Hyde::path('_site/sitemap.xml'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testDefaultExceptionCode()
{
$exception = new BuildTaskSkippedException();

$this->assertSame(0, $exception->getCode());
$this->assertSame(3, $exception->getCode());
}

public function testCustomExceptionCode()
Expand Down
4 changes: 2 additions & 2 deletions packages/framework/tests/Unit/BuildTaskUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function testTaskSkipping()
})->run();
});

$this->assertSame(0, $task->property('exitCode'));
$this->assertSame(3, $task->property('exitCode'));
$this->assertSame('<bg=yellow>Skipped</>', trim($task->buffer[1]));
$this->assertSame('<fg=gray> > Task was skipped</>', $task->buffer[2]);
}
Expand All @@ -205,7 +205,7 @@ public function testTaskSkippingWithCustomMessage()
})->run();
});

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

0 comments on commit d90dcc7

Please sign in to comment.