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
You're not really faking (mocking) the function anymore, but rather creating a proxy function.
I agree this could be easier to find though. I'm just not sure if this belongs as an example here or simply as a Q&A discussion in pester-repo or blog post promoted here as an edge case.
IMO, of those two places, I would say that the mocking page example is the better place. Because $PesterBoundParameters is a bona fide Pester feature, so I wouldn't expect to only be able to learn about it from a link to a blog somewhere. And maybe also on the reference page for the Mock command (mentioned as a special variable available to the script block passed via the -MockWith parameter).
I spent a lot of time trying to figure out how to do something pretty simple:
There are actually two things here that I think should be documented:
@PesterBoundParameters
).While not needed for most mocks, this is a valuable technique, and deserves to be mentioned somewhere.
The text was updated successfully, but these errors were encountered: