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
In the Ky tests, we have a simple assertion that a Node.js DOMException is thrown when a request is aborted. In AVA v5, this assertion works as expected. However, beginning with AVA v6, DOMException seems to no longer be detected as an error, even though error instanceOf Error is true for it.
Minimal reproduction with default config:
importtestfrom'ava';test('DOMException should be considered an error',asynct=>{awaitt.throwsAsync(Promise.reject(newDOMException('an error')));});
The above test passes on AVA v5 but fails on v6. This applies to both t.throws() and t.throwsAsync().
As an aside, the docs are not very clear on what is considered "an error". I always assumed it meant the object had to be an instanceof Error, but at least in AVA v6, this seems to not be the case. Is it because error.constructor.name doesn't include "Error"? Would be nice to have some clarification.
The text was updated successfully, but these errors were encountered:
In the Ky tests, we have a simple assertion that a Node.js
DOMException
is thrown when a request is aborted. In AVA v5, this assertion works as expected. However, beginning with AVA v6,DOMException
seems to no longer be detected as an error, even thougherror instanceOf Error
istrue
for it.Minimal reproduction with default config:
The above test passes on AVA v5 but fails on v6. This applies to both
t.throws()
andt.throwsAsync()
.As an aside, the docs are not very clear on what is considered "an error". I always assumed it meant the object had to be an
instanceof Error
, but at least in AVA v6, this seems to not be the case. Is it becauseerror.constructor.name
doesn't include "Error"? Would be nice to have some clarification.The text was updated successfully, but these errors were encountered: