You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If td.explain is passed an object, it should loop over the functions and, if any test double functions are found, should report some rollup stats (e.g. "my name is this, here are the test doubles, they have X many calls", etc)
Hi,
I've been using testdouble all of 1 week, but I ran into this issue on day 1. (I'm enjoying using it though, so thanks for your hard work.) Having checked the source code for explain I'd be happy to submit a PR based on the approach quoted above:
test the typeof argument passed to explain;
if it's an object, check if each of its values is a test double function (or some nested object with a test double function in there somewhere);
produce a summary report by applying the existing method for explain to each test double in turn.
However, in the issues that reference this one, the discussion seems to take place at the level of the interaction between explain and "the store", which I wouldn't touch with this approach. So as I've not ventured far into the codebase, and this issue has been open a while, I thought I'd ask before I spent the time writing the code: is there a reason you'd prefer to avoid the rock-dumb approach suggested here, or is there some reason why it wouldn't work that I'm missing?
Hey @robwold thank you for the offer! To ensure your time is well spent, how about you send a PR with a quick and dirty proof of concept and then we can discuss that before figuring out how to best incorporate and test it (re: other design concerns)
If td.explain is passed an object, it should loop over the functions and, if any test double functions are found, should report some rollup stats (e.g. "my name is this, here are the test doubles, they have X many calls", etc)
Thanks @johnkpaul for the idea!
The text was updated successfully, but these errors were encountered: