Replies: 1 comment 4 replies
-
Hi. Great question! The behavior is likely too specific to become an official API. If you write a lot of these mocks, I'd try to write a helper function to generate at least the mock scriptblock and counter-variable using the syntax you want. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a recommended way of creating a Pester mock that has a different result for sequential calls?
I currently have a solution that's a bit inelegant that uses a variable to track call counts and returns different results based on that variable.
By inelegant, I mean that there's too much code here to manage the state of the mock. It'd be great if I provide an array of script blocks and the Mock had internal state to track which sequential result is used.
Beta Was this translation helpful? Give feedback.
All reactions