Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overloading rejectedWith to handle undefined input #279

Open
mheine opened this issue Jan 27, 2023 · 0 comments
Open

Overloading rejectedWith to handle undefined input #279

mheine opened this issue Jan 27, 2023 · 0 comments

Comments

@mheine
Copy link

mheine commented Jan 27, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant