diff --git a/src/Functions.php b/src/Functions.php index 362edf5f..34595794 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -194,16 +194,3 @@ if (! function_exists('afterAll')) { TestSuite::getInstance()->afterAll->set($closure); } } - -if (! function_exists('removeAnsiEscapeSequences')) { - /** - * Remove ANSI escape sequences from a given string. - * - * @param string $input The string containing ANSI escape sequences. - * @return string|null A new string with all ANSI escape sequences removed. - */ - function removeAnsiEscapeSequences(string $input): ?string - { - return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input); - } -} diff --git a/tests/Pest.php b/tests/Pest.php index 71751ac4..27c64913 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -39,3 +39,8 @@ function helper_returns_string() } dataset('dataset_in_pest_file', ['A', 'B']); + +function removeAnsiEscapeSequences(string $input): ?string +{ + return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input); +}