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

jest-jasmine2 can't print errors that are not an Error #5963

Closed
wmertens opened this issue Apr 11, 2018 · 2 comments
Closed

jest-jasmine2 can't print errors that are not an Error #5963

wmertens opened this issue Apr 11, 2018 · 2 comments

Comments

@wmertens
Copy link
Contributor

Do you want to request a feature or report a bug?

feature that is in jasmine since v2.6

What is the current behavior?

When a non-error is thrown, jest-jasmine2 turns it into "[Object object]", making it hard to debug. See https://github.com/facebook/jest/blob/1a51672c7597d900953a0b95e4430e65eaa04259/packages/jest-jasmine2/src/jasmine/Env.js#L551-L554

What is the expected behavior?

jasmine has this code: jasmine/jasmine@8807bbb#diff-f41e57b2889bae3046aa9f352699785c

I would expect non-Error exceptions to be formatted as such. This is a valid coding pattern. E.g. React will throw a Promise in the proposed Suspense API.

@SimenB
Copy link
Member

SimenB commented Apr 11, 2018

Tracked in #3839.

PR welcome!

@SimenB SimenB closed this as completed Apr 11, 2018
@github-actions
Copy link

This issue 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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants