mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 02:07:23 +01:00
Adds todo
This commit is contained in:
@ -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')) {
|
if (!function_exists('afterEach')) {
|
||||||
/**
|
/**
|
||||||
* Runs the given closure after each test in the current file.
|
* Runs the given closure after each test in the current file.
|
||||||
|
|||||||
7
tests/Features/Todo.php
Normal file
7
tests/Features/Todo.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
todo('something todo later');
|
||||||
|
|
||||||
|
it('does something within a file with a todo', function () {
|
||||||
|
expect(true)->toBeTrue();
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user