-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPesterTest.ps1
34 lines (28 loc) · 952 Bytes
/
PesterTest.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
31
32
33
34
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[String] $TestPath,
[Parameter(Mandatory)]
[String] $OutputFile
)
$ErrorActionPreference = 'Stop'
Get-ChildItem ([IO.Path]::Combine($PSScriptRoot, 'Modules')) -Directory |
Import-Module -Name { $_.FullName } -Force -DisableNameChecking
[PSCustomObject] $PSVersionTable | Select-Object *, @{
Name = 'Architecture'
Expression = {
switch ([IntPtr]::Size) {
4 { 'x86' }
8 { 'x64' }
default { 'Unknown' }
}
}
} | Format-List | Out-Host
$configuration = [PesterConfiguration]::Default
$configuration.Output.Verbosity = 'Detailed'
$configuration.Run.Path = $TestPath
$configuration.Run.Throw = $true
$configuration.TestResult.Enabled = $true
$configuration.TestResult.OutputPath = $OutputFile
$configuration.TestResult.OutputFormat = 'NUnitXml'
Invoke-Pester -Configuration $configuration -WarningAction Ignore