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

fix(expect-puppeteer): return proper error stack traces from matchers #487

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

OriMarron
Copy link
Contributor

Summary

Currently, errors thrown from matchers have a corrupt stack trace, making it impossible for the developer to tell which line of the test caused the error.
e.g.:
image

With the fix, the errors look good, with all the stack trace info:
image

This bug is caused by calling Error.captureStackTrace with the wrong 2nd parameter. Unfortunately, since createMatcher is not part of the stack trace, the entire stack trace is removed. createMatcher will never be part of the stack trace, the function that should be removed from the trace is the inner function, throwingMatcher.

Copy link
Contributor

@UziTech UziTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 💯 I'll try to get a release out soon.

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.

2 participants