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

Wrap Error.captureStackTrace in a try #4035

Merged
merged 6 commits into from
Jul 14, 2017

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Jul 14, 2017

Summary
Ref #4027

This is a poor-man's version, but it works OK. Not sure we really need to fix it more?

Could put the logic to remove JestAssertionError along with the rest of the stack trace cleanup and avoid Error.captureStackTrace all together?

/cc @skovhus

Test plan
Tests running in browsers should show assertion errors.

@cpojer
Copy link
Member

cpojer commented Jul 14, 2017

This looks good. Can you elaborate the code comment a bit, saying that "Guard for some environments (browsers) that do not support this feature."?

@SimenB
Copy link
Member Author

SimenB commented Jul 14, 2017

Woah, quick! Sure 🙂

@SimenB
Copy link
Member Author

SimenB commented Jul 14, 2017

It looks like this, BTW:
image

@skovhus
Copy link
Contributor

skovhus commented Jul 14, 2017

Looks good @SimenB!

@cpojer cpojer merged commit 5a09a69 into jestjs:master Jul 14, 2017
@SimenB SimenB deleted the stack-trace-no-capture branch July 14, 2017 13:36
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Wrap `Error.captureStackTrace` in a try

Ref jestjs#4027

* Remove console.log

* Add comment

* Improve test

* Readd assertion

* Last assertion tweak
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants