-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGraphEssentials.Tests.ps1
More file actions
26 lines (21 loc) · 941 Bytes
/
Copy pathGraphEssentials.Tests.ps1
File metadata and controls
26 lines (21 loc) · 941 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
$PrimaryModule = Get-ChildItem -Path $PSScriptRoot -Filter '*.psd1' -File -ErrorAction Stop
if ($PrimaryModule.Count -ne 1) {
throw 'Expected exactly one PSD1 file in the repository root.'
}
$availablePester = Get-Module -ListAvailable -Name Pester | Where-Object {
$_.Version -ge [version] '5.0.0'
} | Select-Object -First 1
if (-not $availablePester) {
Install-Module -Name Pester -Scope CurrentUser -Force -AllowClobber -SkipPublisherCheck -ErrorAction Stop
}
Import-Module Pester -Force -ErrorAction Stop
$configuration = [PesterConfiguration]::Default
$configuration.Run.Path = (Join-Path $PSScriptRoot 'Tests')
$configuration.Run.Exit = $true
$configuration.Should.ErrorAction = 'Continue'
$configuration.CodeCoverage.Enabled = $false
$configuration.Output.Verbosity = 'Detailed'
$result = Invoke-Pester -Configuration $configuration
if ($result.FailedCount -gt 0) {
throw "$($result.FailedCount) tests failed."
}