From 592416d280655361e4f809aca0574c40ba3b9281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Thu, 18 Dec 2025 11:21:02 +0100 Subject: [PATCH] feat(test.ps1): add TestName parameter to test.ps1 --- test.ps1 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test.ps1 b/test.ps1 index d34447b..5695fb2 100644 --- a/test.ps1 +++ b/test.ps1 @@ -14,7 +14,8 @@ [CmdletBinding()] param ( - [Parameter()][switch]$ShowTestErrors + [Parameter()][switch]$ShowTestErrors, + [Parameter()][string]$TestName ) function Set-TestName{ @@ -28,7 +29,7 @@ function Set-TestName{ ) process{ - $global:TestName = $TestName + $global:TestNameVar = $TestName } } @@ -40,7 +41,7 @@ function Get-TestName{ ) process{ - $global:TestName + $global:TestNameVar } } @@ -52,7 +53,7 @@ function Clear-TestName{ param ( ) - $global:TestName = $null + $global:TestNameVar = $null } function Import-RequiredModule{ @@ -137,8 +138,8 @@ Import-RequiredModule "TestingHelper" -AllowPrerelease # Install and Load Module dependencies Get-RequiredModule | Import-RequiredModule -AllowPrerelease -if($TestName){ - Invoke-TestingHelper -TestName $TestName -ShowTestErrors:$ShowTestErrors -} else { - Invoke-TestingHelper -ShowTestErrors:$ShowTestErrors -} \ No newline at end of file +# Resolve scoped tests +$TestName = [string]::IsNullOrWhiteSpace($TestName) ? $global:TestNameVar : $TestName + +# Call TestingHelper to run the tests +Invoke-TestingHelper -TestName $TestName -ShowTestErrors:$ShowTestErrors