-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathInvoke-UnitTests.ps1
30 lines (24 loc) · 1.03 KB
/
Invoke-UnitTests.ps1
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
# initialize
.$PSScriptRoot\Tests\Unit\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\Unit\")
$container | Where-Object {$_.Item -like "*PSSA*"} | Foreach-Object {
$_.Data = @{
TestLocation = "$PSScriptRoot\Scripts"
}
}
$configuration = New-PesterConfiguration
$configuration.Run.PassThru = $true
$configuration.Run.Container = $container
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = "testresults.important.xml"
$configuration.Filter.Tag = @("Error")
# Run the tests which are tagged Error
Invoke-Pester -Configuration $configuration
$configuration.TestResult.OutputPath = "testresults.information.xml"
$configuration.Filter.Tag = @("Information","Warning")
# Run the tests which are tagged Information or Warning
Invoke-Pester -Configuration $configuration