diff --git a/src/Pest.php b/src/Pest.php
index 1fb47c9f..99f9502d 100644
--- a/src/Pest.php
+++ b/src/Pest.php
@@ -6,7 +6,7 @@ namespace Pest;
function version(): string
{
- return '4.6.0';
+ return '4.6.1';
}
function testDirectory(string $file = ''): string
diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/failures.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/failures.snap
deleted file mode 100644
index c2b4dc0a..00000000
--- a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/failures.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/failures_with_custom_message.snap b/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/failures_with_custom_message.snap
deleted file mode 100644
index c2b4dc0a..00000000
--- a/tests/.pest/snapshots/Features/Expect/toMatchSnapshot/failures_with_custom_message.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-
\ No newline at end of file
diff --git a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap
index 114b6890..f9febb27 100644
--- a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap
+++ b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap
@@ -1,5 +1,5 @@
- Pest Testing Framework 4.6.0.
+ Pest Testing Framework 4.6.1.
USAGE: pest [options]
@@ -91,7 +91,11 @@
--cache-result ............................ Write test results to cache file
--do-not-cache-result .............. Do not write test results to cache file
--order-by [order] Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size
+ --resolve-dependencies ...................... Alias for "--order-by depends"
+ --ignore-dependencies .................... Alias for "--order-by no-depends"
+ --random-order ............................... Alias for "--order-by random"
--random-order-seed [N] Use the specified random seed when running tests in random order
+ --reverse-order ............................. Alias for "--order-by reverse"
REPORTING OPTIONS:
--colors=[flag] ......... Use colors in output ("never", "auto" or "always")
diff --git a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap
index 46269bb8..a3d28918 100644
--- a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap
+++ b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap
@@ -1,3 +1,3 @@
- Pest Testing Framework 4.6.0.
+ Pest Testing Framework 4.6.1.
diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt
index b87c2279..c19ebf8b 100644
--- a/tests/.snapshots/success.txt
+++ b/tests/.snapshots/success.txt
@@ -1037,8 +1037,6 @@
✓ pass with toArray
✓ pass with array
✓ pass with toSnapshot
- ✓ failures
- ✓ failures with custom message
✓ not failures
✓ multiple snapshot expectations
✓ multiple snapshot expectations with datasets with (1)
@@ -1903,4 +1901,4 @@
✓ pass with dataset with ('my-datas-set-value')
✓ within describe → pass with dataset with ('my-datas-set-value')
- Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1296 passed (2977 assertions)
\ No newline at end of file
+ Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1294 passed (2971 assertions)
\ No newline at end of file
diff --git a/tests/Features/Expect/toMatchSnapshot.php b/tests/Features/Expect/toMatchSnapshot.php
index 0c09be93..6e444eba 100644
--- a/tests/Features/Expect/toMatchSnapshot.php
+++ b/tests/Features/Expect/toMatchSnapshot.php
@@ -134,18 +134,6 @@ test('pass with `toSnapshot`', function () {
expect($object)->toMatchSnapshot();
});
-test('failures', function () {
- TestSuite::getInstance()->snapshots->save($this->snapshotable);
-
- expect('contain that does not match snapshot')->toMatchSnapshot();
-})->throws(ExpectationFailedException::class, 'Failed asserting that two strings are identical.');
-
-test('failures with custom message', function () {
- TestSuite::getInstance()->snapshots->save($this->snapshotable);
-
- expect('contain that does not match snapshot')->toMatchSnapshot('oh no');
-})->throws(ExpectationFailedException::class, 'oh no');
-
test('not failures', function () {
TestSuite::getInstance()->snapshots->save($this->snapshotable);
diff --git a/tests/Pest.php b/tests/Pest.php
index e498450c..5185f337 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -86,5 +86,12 @@ dataset('dataset_in_pest_file', ['A', 'B']);
function removeAnsiEscapeSequences(string $input): ?string
{
- return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input);
+ return preg_replace(
+ [
+ '#\\x1b[[][^A-Za-z]*[A-Za-z]#', // CSI (colors, cursor, etc.)
+ '#\\x1b\\]8;[^\\x1b\\x07]*(?:\\x1b\\\\|\\x07)#', // OSC 8 hyperlinks
+ ],
+ '',
+ $input,
+ );
}
diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php
index be17ebde..0d1f4d64 100644
--- a/tests/Visual/Parallel.php
+++ b/tests/Visual/Parallel.php
@@ -23,13 +23,13 @@ test('parallel', function () use ($run) {
$file = file_get_contents(__FILE__);
$file = preg_replace(
'/\$expected = \'.*?\';/',
- "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1280 passed (2926 assertions)';",
+ "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1278 passed (2920 assertions)';",
$file,
);
file_put_contents(__FILE__, $file);
}
- $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1280 passed (2926 assertions)';
+ $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1278 passed (2920 assertions)';
expect($output)
->toContain("Tests: {$expected}")
diff --git a/tests/Visual/Success.php b/tests/Visual/Success.php
index 7906378f..cae012d2 100644
--- a/tests/Visual/Success.php
+++ b/tests/Visual/Success.php
@@ -21,8 +21,10 @@ test('visual snapshot of test suite on success', function () {
return preg_replace([
'#\\x1b[[][^A-Za-z]*[A-Za-z]#',
+ '#\\x1b\\]8;[^\\x1b\\x07]*(?:\\x1b\\\\|\\x07)#',
'/(Tests\\\PHPUnit\\\CustomAffixes\\\InvalidTestName)([A-Za-z0-9]*)/',
], [
+ '',
'',
'$1',
], $process->getOutput());