Running tests

When not describing tests interactively, as we did in the previous code samples, you can also place them in script files that end in Tests.ps1. When calling Invoke-Pester and giving it a path to work in, Pester will recursively execute all Describe blocks in all *.Tests.ps1 files and display the test results.

In order to only execute specific test cases, you can pass Invoke-Pester the test names to run. Pester will still enumerate all files, but will only execute the selected tests.

To support a release pipeline, Pester can output its results in an XML format called NUnitXML. This test format is used by the popular .NET unit test framework NUnit, and is understood by many CI tools, such as VSTS and AppVeyor. This will allow your CI tools to render test cases nicely, but more importantly, will fail a build and provide valuable input to gatekeepers in your release process.

Whether a manual or an automated gatekeeper, the test results can be used to take your module to the next step in the release pipeline or hand it back to development.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.143.4