Closed
Description
The following test doesn't work.
it("Should throw an error", async () => {
return expect(Promise.reject()).to.be.rejectedWith("Error");
});
Instead of giving details about what went wrong (explaining that it expected the error to be "Error" but instead got undefined), it gives a very un-detailed internal error message as shown below:
TypeError: Cannot read property 'message' of undefined
at Object.compatibleMessage (node_modules/check-error/index.js:78:71)
at getBasePromise.then.reason (node_modules/chai-as-promised/lib/chai-as-promised.js:191:77)
Metadata
Metadata
Assignees
Labels
No labels
Activity