Question: Mocking static class
Powershell 7 used.
I have a module that uses a lot of classes, some of them are static classes. I'm looking for some documentation on how best to mock these methods in the classes, especially the static classes. Can you point me to anything that might help please?
The closest I find is: https://pester.dev/docs/usage/mocking
Which talks about mocking functions that called by classes.
https://gist.github.com/nohwnd/670aa06b989c826c22fab86742a1d6c6 there is only this raw example of how this could be done replacing a method on a static class with Harmony. This is far from finished, but might potentially become a full module. @SeeminglyScience is also doing some research on this. And once I get some time I want to start writing a module around this, which would in the end integrate with (or extend) Pester's Mock.
Wanna help? You can start by showing some examples of what you are trying to do.