diff --git a/src/Functions.php b/src/Functions.php index bfcefddd..66bd4c2f 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -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. diff --git a/tests/Features/Todo.php b/tests/Features/Todo.php new file mode 100644 index 00000000..f9cb4cc8 --- /dev/null +++ b/tests/Features/Todo.php @@ -0,0 +1,7 @@ +toBeTrue(); +});