diff --git a/src/Bootstrappers/BootExcludeList.php b/src/Bootstrappers/BootExcludeList.php new file mode 100644 index 00000000..abd1552c --- /dev/null +++ b/src/Bootstrappers/BootExcludeList.php @@ -0,0 +1,39 @@ + + */ + private const EXCLUDE_LIST = [ + 'bin', + 'overrides', + 'resources', + 'src', + 'stubs', + ]; + + /** + * Boots the "exclude list" for PHPUnit to ignore Pest files. + */ + public function boot(): void + { + $baseDirectory = dirname(__DIR__, 2); + + foreach (self::EXCLUDE_LIST as $directory) { + ExcludeList::addDirectory($baseDirectory.DIRECTORY_SEPARATOR.$directory); + } + } +} diff --git a/src/Kernel.php b/src/Kernel.php index 71bf0479..c5267a79 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -33,6 +33,7 @@ final class Kernel Bootstrappers\BootFiles::class, Bootstrappers\BootView::class, Bootstrappers\BootKernelDump::class, + Bootstrappers\BootExcludeList::class, ]; /** diff --git a/tests/.snapshots/Failure.php.inc b/tests/.snapshots/Failure.php.inc index ef6f7761..058d1e26 100644 --- a/tests/.snapshots/Failure.php.inc +++ b/tests/.snapshots/Failure.php.inc @@ -1,7 +1,7 @@ ##teamcity[testSuiteStarted name='Tests/tests/Failure' locationHint='file://tests/.tests/Failure.php' flowId='1234'] ##teamcity[testCount count='8' flowId='1234'] ##teamcity[testStarted name='it can fail with comparison' locationHint='pest_qn://tests/.tests/Failure.php::it can fail with comparison' flowId='1234'] -##teamcity[testFailed name='it can fail with comparison' message='Failed asserting that true matches expected false.' details='at src/Mixins/Expectation.php:343|nat src/Support/ExpectationPipeline.php:75|nat src/Support/ExpectationPipeline.php:79|nat src/Expectation.php:300|nat tests/.tests/Failure.php:6|nat src/Factories/TestCaseMethodFactory.php:100|nat src/Concerns/Testable.php:302|nat src/Support/ExceptionTrace.php:28|nat src/Concerns/Testable.php:302|nat src/Concerns/Testable.php:221|nat src/Kernel.php:90' type='comparisonFailure' actual='true' expected='false' flowId='1234'] +##teamcity[testFailed name='it can fail with comparison' message='Failed asserting that true matches expected false.' details='at tests/.tests/Failure.php:6' type='comparisonFailure' actual='true' expected='false' flowId='1234'] ##teamcity[testFinished name='it can fail with comparison' duration='100000' flowId='1234'] ##teamcity[testStarted name='it can be ignored because of no assertions' locationHint='pest_qn://tests/.tests/Failure.php::it can be ignored because of no assertions' flowId='1234'] ##teamcity[testIgnored name='it can be ignored because of no assertions' message='This test did not perform any assertions' details='' flowId='1234'] @@ -10,10 +10,10 @@ ##teamcity[testIgnored name='it can be ignored because it is skipped' message='This test was ignored.' details='' flowId='1234'] ##teamcity[testFinished name='it can be ignored because it is skipped' duration='100000' flowId='1234'] ##teamcity[testStarted name='it can fail' locationHint='pest_qn://tests/.tests/Failure.php::it can fail' flowId='1234'] -##teamcity[testFailed name='it can fail' message='oh noo' details='at tests/.tests/Failure.php:18|nat src/Factories/TestCaseMethodFactory.php:100|nat src/Concerns/Testable.php:302|nat src/Support/ExceptionTrace.php:28|nat src/Concerns/Testable.php:302|nat src/Concerns/Testable.php:221|nat src/Kernel.php:90' flowId='1234'] +##teamcity[testFailed name='it can fail' message='oh noo' details='at tests/.tests/Failure.php:18' flowId='1234'] ##teamcity[testFinished name='it can fail' duration='100000' flowId='1234'] ##teamcity[testStarted name='it throws exception' locationHint='pest_qn://tests/.tests/Failure.php::it throws exception' flowId='1234'] -##teamcity[testFailed name='it throws exception' message='Exception: test error' details='at tests/.tests/Failure.php:22|nat src/Factories/TestCaseMethodFactory.php:100|nat src/Concerns/Testable.php:302|nat src/Support/ExceptionTrace.php:28|nat src/Concerns/Testable.php:302|nat src/Concerns/Testable.php:221|nat src/Kernel.php:90' flowId='1234'] +##teamcity[testFailed name='it throws exception' message='Exception: test error' details='at tests/.tests/Failure.php:22' flowId='1234'] ##teamcity[testFinished name='it throws exception' duration='100000' flowId='1234'] ##teamcity[testStarted name='it is not done yet' locationHint='pest_qn://tests/.tests/Failure.php::it is not done yet' flowId='1234'] ##teamcity[testIgnored name='it is not done yet' message='This test was ignored.' details='' flowId='1234'] diff --git a/tests/.snapshots/collision-parallel.txt b/tests/.snapshots/collision-parallel.txt index b8c408e6..5ce9287d 100644 --- a/tests/.snapshots/collision-parallel.txt +++ b/tests/.snapshots/collision-parallel.txt @@ -16,7 +16,6 @@ 9▕ })->skip(! isset($_SERVER['COLLISION_TEST'])); 1 tests/Fixtures/CollisionTest.php:4 - 2 src/Factories/TestCaseMethodFactory.php:100 Tests: 1 failed, 2 passed (2 assertions) \ No newline at end of file diff --git a/tests/.snapshots/collision.txt b/tests/.snapshots/collision.txt index 7b8de7ff..1bc29248 100644 --- a/tests/.snapshots/collision.txt +++ b/tests/.snapshots/collision.txt @@ -18,7 +18,6 @@ 9▕ })->skip(! isset($_SERVER['COLLISION_TEST'])); 1 tests/Fixtures/CollisionTest.php:4 - 2 src/Factories/TestCaseMethodFactory.php:100 Tests: 1 failed, 1 passed (1 assertions) \ No newline at end of file