-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ps1
More file actions
36 lines (28 loc) · 1019 Bytes
/
test.ps1
File metadata and controls
36 lines (28 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Param(
[Parameter(Mandatory = $false)]
[ValidateSet('simple','advanced')]
[string]$Type = "simple",
[Parameter(Mandatory = $false)]
[string]$TestLocation = ".\src\default",
[Parameter(Mandatory = $false)]
[switch]$OutputResults
)
# initialize
.\tests\init\init.ps1
# test
$pestercommand = Get-Command Invoke-Pester
"`n`tSTATUS: Testing with PowerShell $($PSVersionTable.PSVersion.ToString())"
"`tSTATUS: Testing with Pester $($pestercommand.version)`n"
$container = New-PesterContainer -Path (Join-Path -Path $PSScriptRoot -ChildPath "tests/$Type")
$container.Data = @{
TestLocation = $TestLocation
}
$configuration = New-PesterConfiguration
$configuration.Run.PassThru = $true
$configuration.Run.Container = $container
if ($PSBoundParameters.OutputResults.IsPresent) {
# Outputting to file when running in a pipeline
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = "pssa.testresults.xml"
}
Invoke-Pester -Configuration $configuration