Adds todo

This commit is contained in:
Nuno Maduro
2022-09-15 23:08:29 +01:00
parent 02e3b5aa77
commit af82c1005a
2 changed files with 24 additions and 0 deletions

View File

@ -119,6 +119,23 @@ if (!function_exists('it')) {
}
}
if (!function_exists('todo')) {
/**
* Adds the given todo test. Internally, this test
* is marked as incomplete. Yet, Collision, Pest's
* printer, will display it as a "todo" test.
*
* @return TestCall|TestCase|mixed
*/
function todo(string $description): TestCall
{
/* @phpstan-ignore-next-line */
return test($description, fn () => self::markTestSkipped(
'__TODO__',
));
}
}
if (!function_exists('afterEach')) {
/**
* Runs the given closure after each test in the current file.

7
tests/Features/Todo.php Normal file
View File

@ -0,0 +1,7 @@
<?php
todo('something todo later');
it('does something within a file with a todo', function () {
expect(true)->toBeTrue();
});