You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
only allows to define constructor of the error and requires to test message separately, e.g.
consterror=awaitt.throws(createReservation(undefined,parameters,context),UserError);t.true(error.message==='Ticket selection cannot be empty.');
By the way, .throws(function|promise, [error, [message]]) is slightly misleading.
At first I thought the third parameter is the error message, i.e. t.throws(createReservation(undefined, parameters, context), 'Ticket selection cannot be empty.');.
It would be convenient to be able to construct the error as such:
In such case, ava would need to check that the constructor of the object and the message match.
The text was updated successfully, but these errors were encountered:
gajus
changed the title
Provide a convenience syntax for testing error constructor and message
Provide a convenience API for testing error constructor and message
Apr 18, 2017
Duplicate of #1047. I agree it's currently sub-optimal. You should be able to assert the different specifics of an error in one assertion. See my proposal #1047 (comment) and add your thoughts there.
Description
The current API:
only allows to define constructor of the error and requires to test message separately, e.g.
It would be convenient to be able to construct the error as such:
In such case, ava would need to check that the constructor of the object and the message match.
The text was updated successfully, but these errors were encountered: