-
Notifications
You must be signed in to change notification settings - Fork 8
Pester3 Task
The Pester3
tasks runs Pester tests using Pester 3. You pass the path(s) to test to the Path
parameter, which are passed directly to the Invoke-Pester
function's Script
parameter.
By default, the latest verson of Pester 3 is used. To pin to a specific version, set the Version
property to the version you want to use. Wildcards are supported. Pester is installed into a PSModules
directory in your build root.
If any tests fail (i.e. if the FailedCount
property on the result object returned by Invoke-Pester
is greater than 0), the build will fail.
Test reports are saved to the output directory in NUnit XML format. The report files are named pester+RANDOM_STRING.xml
, where RANDOM_STRING
is a random strings of characters.
When running under AppVeyor, test results are also automatically posted to your build's test results.
-
Path
(mandatory): paths to pass to theInvoke-Pester
command'sScript
parameter. Paths must exist and must be under the build root. -
Version
: the version of Pester 3 to use. Defaults to the latest version of Pester 3. Wildcards supported. Use wildcards to pin to a specific minor version, e.g.3.1.*
would use the lastest version of the 3.1 release, but never use 3.2 or later.
Build:
- Pester3:
Path: Test\*.Tests.ps1
Demonstrates the simplest way to use the Pester3
task. In this case, all files that match the Test\*.Tests.ps1
wildcard will be run.
Build:
- Pester3:
Version: 3.4.6
Path: Test\*.Tests.ps1
Demonstrates how to pin to a specific version of Pester 3. In this case, version 3.4.6.
Build:
- Pester3:
Version: 3.4.*
Path: Test\*.Tests.ps1
Demonstrates how to pin to a specific MAJOR.MINOR version of Pester 3. In this case, the lastest 3.4 version would be used.
- Common Task Properties
- AppVeyorWaitForBuildJob
- CopyFile
- Delete
- DotNet
- Exec
- File
- GetPowerShellModule
- GitHubRelease
- InstallNodeJs
- LoadTask
- Log
- MergeFile
- MSBuild
- NuGetPack
- NuGetPush
- NuGetRestore
- NUnit2
- NUnit3
- Parallel
- Pester
- Pipeline
- PowerShell
- ProGetUniversalPackage
- PublishBitbucketServerTag
- PublishBuildMasterPackage
- PublishNodeModule
- PublishPowerShellModule
- PublishProGetAsset
- PublishProGetUniversalPackage
- SetVariable
- SetVariableFromPowerShellDataFile
- SetVariableFromXml
- TaskDefaults
- Version
- Zip