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.
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 waythrowsis always sync andrejectsis always async.I understand if you’d rather just keep
throwsand 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.