Skip to content

Overloading rejectedWith to handle undefined input #279

Open
@mheine

Description

This is more of a general question, and may be more related to chai itself rather than chai-is-promised - apologies if this is the wrong forum.

The rejectedWith function is working as intended according to the documentation; however I stumbled over #123 when I (accidentally) passed undefined as a parameter. I would like to raise some sort of warning when this happens - and I'm not requesting that we change the actual implementation, but I was wondering:

Is there a (simple) way to overload a chai-as-promised method?

As far as I could tell the only realistic way would be to re-write the entire function and then call chai.use(function (_chai, utils) { ... } - is there another way that I am missing?

Cheers, and thank you so much for the work that you've put in!

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