Open frstie opened 1 year ago
Ah, I've just spotted https://github.com/NagRock/ts-mockito/pull/216 - guess this is handled more elegantly with that PR.
Just found the thread about the various forks - is there any consensus on future directions/merging for the different forks?
@frstie this feature is now released under the TypeStrong repo https://github.com/TypeStrong/ts-mockito Another PR for making it handle objects nicely is in progress
When verifying parameters, the various matchers report the value they were expecting, but not the value they received. This sometimes makes it tricky to figure out what went wrong when the test fails.
Simple example:
This results in an error message:
I've put together a quick custom matcher that improves toString() to report the value received as well as the requested match:
The new call to verify:
and the new output:
I'm a new user to the library, wondered if there would be any interest in making the default toString() on the existing matchers support something like this? Happy to contribute a PR if this would be of use to anyone?