Skip to content

fix: exclude plugin frames from failure traces - #328

Open
helmipradita wants to merge 1 commit into
pestphp:5.xfrom
helmipradita:fix/exclude-plugin-frames-from-traces
Open

helmipradita wants to merge 1 commit into
pestphp:5.xfrom
helmipradita:fix/exclude-plugin-frames-from-traces

Conversation

@helmipradita

Copy link
Copy Markdown
Contributor

Part of pestphp/pest#2009 (case 3).

A failing browser check currently reports its location inside
vendor/pestphp/pest-plugin-browser/src/Exceptions/BrowserExpectationFailedException.php
instead of the user's test file, because the plugin never adds its own src
to PHPUnit's ExcludeList. Pest core does this via BootExcludeList; the
browser plugin did not.

This registers the plugin's src directory with PHPUnit\Util\ExcludeList
during Plugin::boot(), so failure traces (and junit/event reports) skip
plugin frames and resolve to the test file.

Scope: case 3 only. Case 1 is covered by #298 and case 2 by #324.

Test: tests/Unit/Plugin/ExcludeListTest.php asserts the plugin source is
excluded after boot. No local PHP toolchain here, so relying on CI
(test:unit, test:types, type-coverage) to verify.

Register the plugin's src directory with PHPUnit's ExcludeList during
boot so a failing browser check is attributed to the user's test file
instead of vendor/pestphp/pest-plugin-browser/src.

Part of pestphp/pest#2009 (case 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant