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!
This is more of a general question, and may be more related to
chai
itself rather thanchai-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) passedundefined
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!