Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pest adapter] Exclude Pest custom expectation code from failure snippets #254

Merged
merged 3 commits into from
Feb 18, 2023
Merged

[Pest adapter] Exclude Pest custom expectation code from failure snippets #254

merged 3 commits into from
Feb 18, 2023

Conversation

fabio-ivona
Copy link
Contributor

@fabio-ivona fabio-ivona commented Feb 18, 2023

This PR will help showing the right code snippet when a Pest custom expectation fails.

A quick solution would be to just ignore tests/Pest.php file, but this won't solve the issue when expectations are extended inside external packages or different files. This fix uses reflections to detect the lines where expectation extension happened and skips their snippets frames.

before:

image

after:

image

@fabio-ivona
Copy link
Contributor Author

will add tests soon, just understanding how they works

src/Writer.php Outdated Show resolved Hide resolved
src/Writer.php Outdated Show resolved Hide resolved
src/Writer.php Outdated Show resolved Hide resolved
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.

None yet

2 participants