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

assert.rejects() and asserts.not.rejects() for promises #131

Open
aral opened this issue Aug 10, 2021 · 1 comment · May be fixed by #132
Open

assert.rejects() and asserts.not.rejects() for promises #131

aral opened this issue Aug 10, 2021 · 1 comment · May be fixed by #132

Comments

@aral
Copy link

aral commented Aug 10, 2021

It would be nice to have an async equivalent of assert.throws() for promise rejections.

While this can be handled via a workaround, having a separate method does cut down on boilerplate.

Instead of overloading throws, I feel it makes sense to have a separate method for promise rejections. This way throws is always sync and rejects is always async.

I understand if you’d rather just keep throws and the workaround, just wanted to share my addition upstream. Please feel free to close this issue and the pull request if you feel this is out of scope or complicates the API beyond what you’re comfortable with.

@aral
Copy link
Author

aral commented Aug 10, 2021

Pull request: #132

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 a pull request may close this issue.

1 participant