Skip to content

Commit 20b7d0b

Browse files
author
Friedrich Weinmann
committed
test updates
1 parent 883d149 commit 20b7d0b

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

PSModuleDevelopment/functions/refactor/Export-PSMDString.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
foreach ($splattedVariable in $splattedVariables)
8585
{
8686
#get the variable name
87-
$splatParamName = $splattedVariable.VariablePath.UserPath
87+
$splatParamName = $splattedVariable.VariablePath.UserPath
8888
if ($splatParamName)
8989
{
9090
# match the $param = @{
@@ -93,7 +93,7 @@
9393
# left side matches our param
9494
# operator is =
9595
# matches our assignment regex
96-
$splatAssignmentAsts = $ast.FindAll( {
96+
$splatAssignmentAsts = $ast.FindAll( {
9797
if ($args[0] -isnot [System.Management.Automation.Language.AssignmentStatementAst ]) { return $false }
9898
if (-not ($args[0].Left -match $splatParamName)) { return $false }
9999
if (-not ($args[0].Operator -eq 'Equals')) { return $false }

PSModuleDevelopment/tests/pester.ps1

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ $totalFailed = 0
3333
$totalRun = 0
3434

3535
$testresults = @()
36-
[PesterConfiguration]::Default.TestResult.Enabled = $true
36+
$config = [PesterConfiguration]::Default
37+
$config.TestResult.Enabled = $true
3738

3839
#region Run General Tests
3940
if ($TestGeneral)
@@ -45,8 +46,11 @@ if ($TestGeneral)
4546
if ($file.Name -like $Exclude) { continue }
4647

4748
Write-PSFMessage -Level Significant -Message " Executing <c='em'>$($file.Name)</c>"
48-
[PesterConfiguration]::Default.TestResult.OutputPath = Join-Path "$PSScriptRoot\..\..\TestResults" "TEST-$($file.BaseName).xml"
49-
$results = Invoke-Pester -Path $file.FullName -Output $Output -PassThru
49+
$config.TestResult.OutputPath = Join-Path "$PSScriptRoot\..\..\TestResults" "TEST-$($file.BaseName).xml"
50+
$config.Run.Path = $file.FullName
51+
$config.Run.PassThru = $true
52+
$config.Output.Verbosity = $Output
53+
$results = Invoke-Pester -Configuration $config
5054
foreach ($result in $results)
5155
{
5256
$totalRun += $result.TotalCount
@@ -76,8 +80,11 @@ if ($TestFunctions)
7680
if ($file.Name -like $Exclude) { continue }
7781

7882
Write-PSFMessage -Level Significant -Message " Executing $($file.Name)"
79-
[PesterConfiguration]::Default.TestResult.OutputPath = Join-Path "$PSScriptRoot\..\..\TestResults" "TEST-$($file.BaseName).xml"
80-
$results = Invoke-Pester -Path $file.FullName -Output $Output -PassThru
83+
$config.TestResult.OutputPath = Join-Path "$PSScriptRoot\..\..\TestResults" "TEST-$($file.BaseName).xml"
84+
$config.Run.Path = $file.FullName
85+
$config.Run.PassThru = $true
86+
$config.Output.Verbosity = $Output
87+
$results = Invoke-Pester -Configuration $config
8188
foreach ($result in $results)
8289
{
8390
$totalRun += $result.TotalCount

0 commit comments

Comments
 (0)