Repository navigation
fix: exclude plugin frames from failure traces - #328
Open
helmipradita wants to merge 1 commit into
Open
helmipradita wants to merge 1 commit into
helmipradita wants to merge 1 commit into
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of pestphp/pest#2009 (case 3).
A failing browser check currently reports its location inside
vendor/pestphp/pest-plugin-browser/src/Exceptions/BrowserExpectationFailedException.phpinstead of the user's test file, because the plugin never adds its own
srcto PHPUnit's
ExcludeList. Pest core does this viaBootExcludeList; thebrowser plugin did not.
This registers the plugin's
srcdirectory withPHPUnit\Util\ExcludeListduring
Plugin::boot(), so failure traces (and junit/event reports) skipplugin 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.phpasserts the plugin source isexcluded after boot. No local PHP toolchain here, so relying on CI
(
test:unit,test:types, type-coverage) to verify.