Open gamtiq opened 7 years ago
Hi @gamtiq, thanks for the note!
I think for the strict .not.to.have.been.called
case, I want to keep it just a simple boolean result by default. I do think there's room for a new assertion that exposes more of the info testdouble.js makes available, though. Maybe something like .to.have.been.called.(3).times
(but not exactly that syntax, probably).
I also see that chai
itself has some config variables that control how much data it prints out. I hadn't noticed those before; there's probably room to add our own config vars in testdouble-chai
to control the behavior you're talking about.
I'll leave this issue open as a reminder to think about that. In the meantime, if you need the extra data, I'd say just drop down to using td's own verify
. Hopefully I'll have a chance to add some stuff soon!
testdouble
creates quite useful message when a verification is failed.testdouble-chai
generates more concise message which is lacking helpful data sometimes. For example,generates the following message:
Whereas the corresponding assertion
prints the following error:
Is it possible to have more detailed error messages containing data about call arguments? Sometimes it can be very useful to find and fix tests.