Skip to content

rejectedWith when error is undefined doesn't work #263

Closed
@fishcharlie

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions