Pester: starting to use it

I have started to move my PowerShell tests into Pester, and I like it. At the same time I have been using the PowerShell plug-in in VS Code, and I will not be going back (Well, right now, I still use the ISE for debugging, but I expect that might be available in VS Code at some time). Incredibly, Go To Definition exists, and works, taking you to a separate file if that is where the function is:

And you have any number of themes in VS Code (I’m using version 1.4.0 right now).

The PS plugin also has an automatic linter/hinter. For example, here it objects to the unapproved verb:

And finally just to show the Pester output from a passing and a failing test:

The code for the above is here (Utilities.ps1 and UtilitiesTest.ps1).

Advertisements