40 lines
1.2 KiB
PowerShell
40 lines
1.2 KiB
PowerShell
|
|
<#
|
||
|
|
Shared Pester configuration.
|
||
|
|
|
||
|
|
Three suites, separated by tag so the offline set can be run with no tenant,
|
||
|
|
no credentials, and no network (SC-008):
|
||
|
|
|
||
|
|
Offline - rule engine, normalization, configuration validation
|
||
|
|
Safety - zero-write and single-attribute-body assertions (mocked adapter)
|
||
|
|
Integration - requires a delegated read-only tenant connection (Stage A2)
|
||
|
|
|
||
|
|
Usage:
|
||
|
|
$cfg = & ./tests/PesterConfiguration.ps1 -Suite Offline
|
||
|
|
Invoke-Pester -Configuration $cfg
|
||
|
|
#>
|
||
|
|
[CmdletBinding()]
|
||
|
|
param(
|
||
|
|
[ValidateSet('Offline', 'Safety', 'Integration', 'All')]
|
||
|
|
[string] $Suite = 'Offline',
|
||
|
|
|
||
|
|
[string] $Path = (Join-Path $PSScriptRoot '.')
|
||
|
|
)
|
||
|
|
|
||
|
|
$config = New-PesterConfiguration
|
||
|
|
$config.Run.Path = $Path
|
||
|
|
$config.Output.Verbosity = 'Detailed'
|
||
|
|
$config.Should.ErrorAction = 'Continue'
|
||
|
|
|
||
|
|
switch ($Suite) {
|
||
|
|
'Offline' {
|
||
|
|
# Integration is excluded rather than Offline included, so a new suite
|
||
|
|
# that forgets its tag still runs offline instead of silently never running.
|
||
|
|
$config.Filter.ExcludeTag = @('Integration')
|
||
|
|
}
|
||
|
|
'Safety' { $config.Filter.Tag = @('Safety') }
|
||
|
|
'Integration' { $config.Filter.Tag = @('Integration') }
|
||
|
|
'All' { }
|
||
|
|
}
|
||
|
|
|
||
|
|
$config
|