-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
The new await reject that helps test promise rejections only supports two specific validation methods on the returned error.
It would be much more useful, if it can support additional custom validation, either through a callback, or by returning the error.
Example:
await expect(somePromise).to.reject((err) => {
expect(err.isBoom).to.exist();
});Alternatively:
const err = await expect(somePromise).to.reject();
expect(err.isBoom).to.exist();This mode looks cleaner, but is a bit weird, since it requires reject to resolve with the error.
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement