If you have got this far, like I did a while ago, and you have watched a few intro videos (like this one https://www.youtube.com/watch?v=gssAtCeMOoo and this one https://www.youtube.com/watch?v=0fFrWIxVDl0 ) and you have downloaded Pester from GitHub (https://github.com/pester/Pester) and you have copied the extracted folder to the PowerShell modules directory; then you may just hit these issues working in Visual Studio:
- VS Test Runner fails your embryonic unit test because it can't find the Pester module:Check the name of the folder in the PS Module directory and make sure it is called "Pester" rather than "pester-master" which is what it extracts to
- VS Test Runner fails your test because PowerShell's Execution Policy doesn't allow Pester's scripts to run:The PS execution policy is causing the issue. Unblock the Pester ps1 files using the Unblock-File cmdlet.
- Your test doesn't show up in the VS Test Explorer
Check that you are not using dynamic names for your Describe block, the test explorer doesn't know what to do with those.
Now to write some grown up unit tests...