r/PowerShell • u/nkasco • Dec 10 '25
Question How Often Do You Write Pester tests?
Topic, genuinely curious.
20
Upvotes
r/PowerShell • u/nkasco • Dec 10 '25
Topic, genuinely curious.
View all comments
2
u/PanosGreg Dec 10 '25
Same here as u/BlackV , I write pester tests very rarely.
In fact, I use them for a very specific reason, to do integration testing only
That means I never use them for unit testing, as-in I never write mock functions, so I never check how a function works internally, but rather if it works as expected.
I almost always use Pester tests to check if the resulting system is in the desired state or if it is in a ready (as-in expected state). Which means that the system under test (the so-called SUT), needs to be present, which means in my case most of the times I cannot just run the test on my laptop, but rather I need to execute it on the real system (which has access to stuff, which runs the actual service, which has dependencies and they need to be available, etc)