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

feature(expect): Return the error from toThrow and toThrowError #8718

Closed
wants to merge 1 commit into from

Conversation

chrisblossom
Copy link
Contributor

@chrisblossom chrisblossom commented Jul 18, 2019

Summary

When working with a project that uses ava I noticed their .throws and .throwsAsync return the original error. It is very convenient.

This would make it possible to never need the expect.hasAssertions() + try / catch syntax.

Closes #8698.

Test plan

Added several tests.

@chrisblossom
Copy link
Contributor Author

I am unsure why the "lint-and-typecheck" run is failing. I am unable to reproduce locally.

@SimenB
Copy link
Member

SimenB commented Jul 18, 2019

rm packages/*/tsconfig.tsbuildinfo && yarn watch:ts passes locally?

@chrisblossom
Copy link
Contributor Author

No it doesn't. Not sure what I was doing before. Going to hold off on fixing the errors until the discussion in #8698 is resolved.

@github-actions
Copy link

github-actions bot commented Sep 8, 2022

This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Sep 8, 2022
@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this Oct 8, 2022
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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 Nov 8, 2022
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.

toThrow should return the error
3 participants