-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Ran into a use case recently, where I'd like to assert on error codes and some more meta information.
I'm thinking about error([type], [message], [values]) / throw([type], [message], [values]), e.g.
expect(() => someMethod()).to.throw(CustomError, 'Oh no!', { code: 'E_NOENT' });
This would essentially do an extra expect(error).to.include(values); - there is no other way to check this when using to.throw() AFAIK?
Happy to PR if acceptable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement