From 5b3a8ddf2b47abacfd8c0810a72678354687f0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:14:35 +0100 Subject: [PATCH 01/10] feat(tests): add functions to run before and after tests --- Test/{include => public}/run_BeforeAfter.ps1 | 2 -- 1 file changed, 2 deletions(-) rename Test/{include => public}/run_BeforeAfter.ps1 (95%) diff --git a/Test/include/run_BeforeAfter.ps1 b/Test/public/run_BeforeAfter.ps1 similarity index 95% rename from Test/include/run_BeforeAfter.ps1 rename to Test/public/run_BeforeAfter.ps1 index a0e534a..15439ee 100644 --- a/Test/include/run_BeforeAfter.ps1 +++ b/Test/public/run_BeforeAfter.ps1 @@ -16,8 +16,6 @@ function Run_AfterAll{ function Run_BeforeEach{ Write-Verbose "Run_BeforeEach" - - Reset_Test_Mock } function Run_AfterEach{ From f59f759112a79ddfe7625a42c85721386df1a723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:14:45 +0100 Subject: [PATCH 02/10] refactor(Export-MyTranscript): change parameter type from array to string array --- Test/include/transcriptHelp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/include/transcriptHelp.ps1 b/Test/include/transcriptHelp.ps1 index 267480e..892d25e 100644 --- a/Test/include/transcriptHelp.ps1 +++ b/Test/include/transcriptHelp.ps1 @@ -32,7 +32,7 @@ function Export-MyTranscript { [CmdletBinding()] param ( [Parameter(Mandatory, Position = 0)] - [array]$transcriptContent + [string[]]$transcriptContent ) $i = 0..($transcriptContent.Count - 1) | Where-Object { $transcriptContent[$_] -eq "**********************" } From 26942c32bdd877bf97c7c61d74a4f59779472dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:14:55 +0100 Subject: [PATCH 03/10] fix(readMockCommandFile): ensure function returns empty list if file does not exist --- Test/include/InvokeMockList.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Test/include/InvokeMockList.ps1 b/Test/include/InvokeMockList.ps1 index 3c867a8..fcb3ecd 100644 --- a/Test/include/InvokeMockList.ps1 +++ b/Test/include/InvokeMockList.ps1 @@ -30,6 +30,12 @@ function Trace-MockCommandFile{ } function readMockCommandFile{ + + # Return empty list if the file does not exist + if(-not (Test-Path -Path $MockCommandFile)){ + return @() + } + $ret = Get-Content -Path $MockCommandFile | ConvertFrom-Json # return an empty aray if content does not exists From 308e26d98678b47db984e8932a6ae255268249e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:15:52 +0100 Subject: [PATCH 04/10] refactor(module.helper): update folder names for IncludeHelper and improve folder handling --- Test/helper/module.helper.ps1 | 121 ++++++++++++++++++++-------------- helper/module.helper.ps1 | 121 ++++++++++++++++++++-------------- 2 files changed, 140 insertions(+), 102 deletions(-) diff --git a/Test/helper/module.helper.ps1 b/Test/helper/module.helper.ps1 index 79e9af3..670d090 100644 --- a/Test/helper/module.helper.ps1 +++ b/Test/helper/module.helper.ps1 @@ -36,8 +36,45 @@ $MODULE_NAME = (Get-ChildItem -Path $MODULE_ROOT_PATH -Filter *.psd1 | Select-Ob # Helper for module variables - -$VALID_FOLDER_NAMES = @('Include', 'Private', 'Public', 'Root', 'TestInclude', 'TestPrivate', 'TestPublic', 'TestRoot', 'Tools', 'DevContainer', 'WorkFlows', 'GitHub', 'Helper', 'Config', 'TestHelper', 'TestConfig') +# Folders names that IncludeHelper may add content to +$VALID_INCLUDE_FOLDER_NAMES = @( + 'Root', + 'Include', + 'DevContainer', + 'WorkFlows', + 'GitHub', + # 'Config', + 'Helper', + # 'Private', + # 'Public', + 'Tools', + + 'TestRoot', + # 'TestConfig' + 'TestInclude', + 'TestHelper', + # 'TestPrivate', + # 'TestPublic', + + "TestHelperRoot", + "TestHelperPrivate", + "TestHelperPublic" + + "VsCode" +) + +# Folders names that IncludeHelper should not add content to. +# In this folders is the module code itself +$VALID_MODULE_FOLDER_NAMES = @( + 'Config', + 'Private', + 'Public', + 'TestConfig' + 'TestPrivate', + 'TestPublic' +) + +$VALID_FOLDER_NAMES = $VALID_INCLUDE_FOLDER_NAMES + $VALID_MODULE_FOLDER_NAMES class ValidFolderNames : System.Management.Automation.IValidateSetValuesGenerator { [String[]] GetValidValues() { @@ -113,59 +150,41 @@ function Get-ModuleFolder{ # TestRootPath $testRootPath = $ModuleRootPath | Join-Path -ChildPath "Test" + $testHelperRootPath = $ModuleRootPath | Join-Path -ChildPath "tools/Test_Helper" switch ($FolderName){ - 'Public'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "public" - } - 'Private'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "private" - } - 'Include'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "include" - } - 'TestInclude'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "include" - } - 'TestPrivate'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "private" - } - 'TestPublic'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "public" - } - 'Root'{ - $moduleFolder = $ModuleRootPath - } - 'TestRoot'{ - $moduleFolder = $testRootPath - } - 'Tools'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "tools" - } - 'DevContainer'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".devcontainer" - } - 'WorkFlows'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github/workflows" - } - 'GitHub'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github" - } - 'Helper'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "helper" - } - 'Config'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "config" - } - 'TestHelper'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "helper" - } - 'TestConfig'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "config" - } + + # VALID_INCLUDE_FOLDER_NAMES + 'Root' { $moduleFolder = $ModuleRootPath } + 'Include' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "include" } + 'DevContainer'{ $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".devcontainer" } + 'WorkFlows' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github/workflows" } + 'GitHub' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github" } + 'Helper' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "helper" } + 'Tools' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "tools" } + + 'TestRoot' { $moduleFolder = $testRootPath } + 'TestInclude' { $moduleFolder = $testRootPath | Join-Path -ChildPath "include" } + 'TestHelper' { $moduleFolder = $testRootPath | Join-Path -ChildPath "helper" } + + 'TestHelperRoot' { $moduleFolder = $testHelperRootPath } + 'TestHelperPrivate' { $moduleFolder = $testHelperRootPath | Join-Path -ChildPath "private" } + 'TestHelperPublic' { $moduleFolder = $testHelperRootPath | Join-Path -ChildPath "public" } + + "VsCode" { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".vscode" } + + # VALID_MODULE_FOLDER_NAMES + 'Config' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "config" } + 'Private' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "private" } + 'Public' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "public" } + 'TestConfig' { $moduleFolder = $testRootPath | Join-Path -ChildPath "config" } + 'TestPrivate' { $moduleFolder = $testRootPath | Join-Path -ChildPath "private" } + 'TestPublic' { $moduleFolder = $testRootPath | Join-Path -ChildPath "public" } + + default{ throw "Folder [$FolderName] is unknown" } } return $moduleFolder -} Export-ModuleMember -Function Get-ModuleFolder +} Export-ModuleMember -Function Get-ModuleFolder \ No newline at end of file diff --git a/helper/module.helper.ps1 b/helper/module.helper.ps1 index 79e9af3..670d090 100644 --- a/helper/module.helper.ps1 +++ b/helper/module.helper.ps1 @@ -36,8 +36,45 @@ $MODULE_NAME = (Get-ChildItem -Path $MODULE_ROOT_PATH -Filter *.psd1 | Select-Ob # Helper for module variables - -$VALID_FOLDER_NAMES = @('Include', 'Private', 'Public', 'Root', 'TestInclude', 'TestPrivate', 'TestPublic', 'TestRoot', 'Tools', 'DevContainer', 'WorkFlows', 'GitHub', 'Helper', 'Config', 'TestHelper', 'TestConfig') +# Folders names that IncludeHelper may add content to +$VALID_INCLUDE_FOLDER_NAMES = @( + 'Root', + 'Include', + 'DevContainer', + 'WorkFlows', + 'GitHub', + # 'Config', + 'Helper', + # 'Private', + # 'Public', + 'Tools', + + 'TestRoot', + # 'TestConfig' + 'TestInclude', + 'TestHelper', + # 'TestPrivate', + # 'TestPublic', + + "TestHelperRoot", + "TestHelperPrivate", + "TestHelperPublic" + + "VsCode" +) + +# Folders names that IncludeHelper should not add content to. +# In this folders is the module code itself +$VALID_MODULE_FOLDER_NAMES = @( + 'Config', + 'Private', + 'Public', + 'TestConfig' + 'TestPrivate', + 'TestPublic' +) + +$VALID_FOLDER_NAMES = $VALID_INCLUDE_FOLDER_NAMES + $VALID_MODULE_FOLDER_NAMES class ValidFolderNames : System.Management.Automation.IValidateSetValuesGenerator { [String[]] GetValidValues() { @@ -113,59 +150,41 @@ function Get-ModuleFolder{ # TestRootPath $testRootPath = $ModuleRootPath | Join-Path -ChildPath "Test" + $testHelperRootPath = $ModuleRootPath | Join-Path -ChildPath "tools/Test_Helper" switch ($FolderName){ - 'Public'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "public" - } - 'Private'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "private" - } - 'Include'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "include" - } - 'TestInclude'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "include" - } - 'TestPrivate'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "private" - } - 'TestPublic'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "public" - } - 'Root'{ - $moduleFolder = $ModuleRootPath - } - 'TestRoot'{ - $moduleFolder = $testRootPath - } - 'Tools'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "tools" - } - 'DevContainer'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".devcontainer" - } - 'WorkFlows'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github/workflows" - } - 'GitHub'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github" - } - 'Helper'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "helper" - } - 'Config'{ - $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "config" - } - 'TestHelper'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "helper" - } - 'TestConfig'{ - $moduleFolder = $testRootPath | Join-Path -ChildPath "config" - } + + # VALID_INCLUDE_FOLDER_NAMES + 'Root' { $moduleFolder = $ModuleRootPath } + 'Include' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "include" } + 'DevContainer'{ $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".devcontainer" } + 'WorkFlows' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github/workflows" } + 'GitHub' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".github" } + 'Helper' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "helper" } + 'Tools' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "tools" } + + 'TestRoot' { $moduleFolder = $testRootPath } + 'TestInclude' { $moduleFolder = $testRootPath | Join-Path -ChildPath "include" } + 'TestHelper' { $moduleFolder = $testRootPath | Join-Path -ChildPath "helper" } + + 'TestHelperRoot' { $moduleFolder = $testHelperRootPath } + 'TestHelperPrivate' { $moduleFolder = $testHelperRootPath | Join-Path -ChildPath "private" } + 'TestHelperPublic' { $moduleFolder = $testHelperRootPath | Join-Path -ChildPath "public" } + + "VsCode" { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath ".vscode" } + + # VALID_MODULE_FOLDER_NAMES + 'Config' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "config" } + 'Private' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "private" } + 'Public' { $moduleFolder = $ModuleRootPath | Join-Path -ChildPath "public" } + 'TestConfig' { $moduleFolder = $testRootPath | Join-Path -ChildPath "config" } + 'TestPrivate' { $moduleFolder = $testRootPath | Join-Path -ChildPath "private" } + 'TestPublic' { $moduleFolder = $testRootPath | Join-Path -ChildPath "public" } + + default{ throw "Folder [$FolderName] is unknown" } } return $moduleFolder -} Export-ModuleMember -Function Get-ModuleFolder +} Export-ModuleMember -Function Get-ModuleFolder \ No newline at end of file From 446f92ee3533356c302933282c3040df209b627a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:18:09 +0100 Subject: [PATCH 05/10] feat(debug): add logging functionality for debug messages --- include/MyWrite.ps1 | 58 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/include/MyWrite.ps1 b/include/MyWrite.ps1 index 7e8ffbb..5226eab 100644 --- a/include/MyWrite.ps1 +++ b/include/MyWrite.ps1 @@ -75,8 +75,42 @@ function Write-MyDebug { $message = $message + " - " + $objString } $timestamp = Get-Date -Format 'HH:mm:ss.fff' - "[$timestamp][D][$section] $message" | Write-ToConsole -Color $DEBUG_COLOR + + # Write on host + $logMessage ="[$timestamp][D][$section] $message" + + $logMessage | Write-ToConsole -Color $DEBUG_COLOR + $logMessage | Write-MyDebugLogging + } + } +} + +function Write-MyDebugLogging { + param( + [Parameter(Position = 1, ValueFromPipeline)][string]$LogMessage + ) + + process{ + + $moduleDebugLoggingVarName = $MODULE_NAME + "_DEBUG_LOGGING_FILEPATH" + $loggingFilePath = [System.Environment]::GetEnvironmentVariable($moduleDebugLoggingVarName) + + # Check if logging is enabled + if ([string]::IsNullOrWhiteSpace( $loggingFilePath )) { + return } + + # Check if file exists + # This should always exist as logging checks for parent path to be enabled + # It may happen if since enable to execution the parent folder aka loggingFilePath is deleted. + if(-not (Test-Path -Path $loggingFilePath) ){ + Write-Warning "Debug logging file path not accesible : '$loggingFilePath'" + return $false + } + + # Write to log file + $logFilePath = Join-Path -Path $loggingFilePath -ChildPath "$($MODULE_NAME)_debug.log" + Add-Content -Path $logFilePath -Value $LogMessage } } @@ -140,7 +174,8 @@ Export-ModuleMember -Function "Disable-$($MODULE_NAME)Verbose" function Test-MyDebug { param( - [Parameter(Position = 0)][string]$section + [Parameter(Position = 0)][string]$section, + [Parameter()][switch]$Logging ) # Get the module debug environment variable @@ -161,9 +196,22 @@ function Test-MyDebug { function Enable-ModuleNameDebug{ param( - [Parameter(Position = 0)][string]$section + [Parameter(Position = 0)][string]$section, + [Parameter()][string]$LoggingFilePath ) + # Check if logging file path is provided + if( -Not ( [string]::IsNullOrWhiteSpace( $LoggingFilePath )) ) { + if(Test-Path -Path $LoggingFilePath){ + $moduleDEbugLoggingVarName = $MODULE_NAME + "_DEBUG_LOGGING_FILEPATH" + [System.Environment]::SetEnvironmentVariable($moduleDEbugLoggingVarName, $LoggingFilePath) + } else { + Write-Error "Logging file path '$LoggingFilePath' does not exist. Debug logging will not be enabled." + return + } + } + + # Check section value if( [string]::IsNullOrWhiteSpace( $section )) { $flag = "all" } else { @@ -172,6 +220,7 @@ function Enable-ModuleNameDebug{ $moduleDebugVarName = $MODULE_NAME + "_DEBUG" [System.Environment]::SetEnvironmentVariable($moduleDebugVarName, $flag) + } Copy-Item -path Function:Enable-ModuleNameDebug -Destination Function:"Enable-$($MODULE_NAME)Debug" Export-ModuleMember -Function "Enable-$($MODULE_NAME)Debug" @@ -181,6 +230,9 @@ function Disable-ModuleNameDebug { $moduleDebugVarName = $MODULE_NAME + "_DEBUG" [System.Environment]::SetEnvironmentVariable($moduleDebugVarName, $null) + + $moduleDEbugLoggingVarName = $MODULE_NAME + "_DEBUG_LOGGING_FILEPATH" + [System.Environment]::SetEnvironmentVariable($moduleDEbugLoggingVarName, $null) } Copy-Item -path Function:Disable-ModuleNameDebug -Destination Function:"Disable-$($MODULE_NAME)Debug" Export-ModuleMember -Function "Disable-$($MODULE_NAME)Debug" From 18de122f6cf7d40e7a763378bc05d719421e3ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:18:25 +0100 Subject: [PATCH 06/10] refactor(config.mock): replace hardcoded module name with placeholder in config path command --- Test/include/config.mock.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Test/include/config.mock.ps1 b/Test/include/config.mock.ps1 index 8353236..9a50f77 100644 --- a/Test/include/config.mock.ps1 +++ b/Test/include/config.mock.ps1 @@ -9,7 +9,7 @@ if(-not $MODULE_NAME){ throw "Missing MODULE_NAME varaible initialization. Check for module.helerp.ps1 file." } $MOCK_CONFIG_PATH = "test_config_path" -$CONFIG_INVOKE_GET_ROOT_PATH_CMD = "Invoke-ProjectHelperGetConfigRootPath" +$CONFIG_INVOKE_GET_ROOT_PATH_CMD = "Invoke-{modulename}GetConfigRootPath" function Mock_Config{ param( @@ -40,9 +40,9 @@ function Mock_Config{ $moduleName = $MODULE_NAME } - $invokefunction = $CONFIG_INVOKE_GET_ROOT_PATH_CMD -replace "ProjectHelper", $moduleName + $invokefunction = $CONFIG_INVOKE_GET_ROOT_PATH_CMD -replace "{modulename}", $moduleName # Mock invoke call MockCallToString $invokefunction -OutString $fullpath -} +} \ No newline at end of file From c8cc83cf86b0c7266356b72000837c2d50875385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 13:18:34 +0100 Subject: [PATCH 07/10] feat(invokeCommand): add function to retrieve trace invoke file path --- Test/include/invokeCommand.mock.ps1 | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Test/include/invokeCommand.mock.ps1 b/Test/include/invokeCommand.mock.ps1 index 78304de..5f3b13f 100644 --- a/Test/include/invokeCommand.mock.ps1 +++ b/Test/include/invokeCommand.mock.ps1 @@ -15,9 +15,22 @@ $testRootPath = $MODULE_ROOT_PATH | Join-Path -ChildPath 'Test' $MOCK_PATH = $testRootPath | Join-Path -ChildPath 'private' -AdditionalChildPath 'mocks' $MODULE_INVOKATION_TAG = "$($MODULE_NAME)Module" +$MODULE_INVOKATION_TEST_TAG = "$($MODULE_NAME)TestModule" $MODULE_INVOKATION_TAG_MOCK = "$($MODULE_INVOKATION_TAG)_Mock" -$TraceInvokeMock = $testRootPath | Join-Path -ChildPath "traceInvoke.log" +$TraceInvokeFilePathCommand = "Get-$($MODULE_NAME)TraceInvokeFilePath" + +function Invoke-ModuleNameGetTraceInvokeFilePath{ + [CmdletBinding()] + param() + + $filePath = $testRootPath | Join-Path -ChildPath "traceInvoke.log" + + return $filePath +} +Copy-Item -path Function:Invoke-ModuleNameGetTraceInvokeFilePath -Destination Function:"Invoke-$($MODULE_NAME)GetTraceInvokeFilePath" +Export-ModuleMember -Function "Invoke-$($MODULE_NAME)GetTraceInvokeFilePath" +InvokeHelper\Set-InvokeCommandAlias -Alias $TraceInvokeFilePathCommand -Command "Invoke-$($MODULE_NAME)GetTraceInvokeFilePath" -Tag $MODULE_INVOKATION_TEST_TAG function Trace-InvokeCommandAlias{ [CmdletBinding()] @@ -25,11 +38,9 @@ function Trace-InvokeCommandAlias{ [Parameter(Mandatory,Position=0)][string]$Alias ) - $filePath = $TraceInvokeMock + $filePath = Invoke-MyCommand -Command $TraceInvokeFilePathCommand - if(! $filePath){ return } - - # if(! (Test-Path $filePath)) {return} + if(! (Test-Path $filePath)) {return} $content = Get-Content $filePath @@ -292,4 +303,4 @@ function Assert-MockFileNotfound{ Wait-Debugger throw "File not found or wrong case name. Expected[ $filename ] - Found[$( $file.name )]" } -} +} \ No newline at end of file From 6c189bd32fdedc3c99e4be238936664819788ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Mon, 2 Feb 2026 17:44:27 +0100 Subject: [PATCH 08/10] style: fix formatting issues in config and test scripts --- .github/copilot-commit-message-instructions.md | 2 +- Test/Test.psm1 | 2 +- include/config.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/copilot-commit-message-instructions.md b/.github/copilot-commit-message-instructions.md index 2297468..4007169 100644 --- a/.github/copilot-commit-message-instructions.md +++ b/.github/copilot-commit-message-instructions.md @@ -31,4 +31,4 @@ References: - https://www.conventionalcommits.org/ - https://seesparkbox.com/foundry/semantic_commit_messages -- http://karma-runner.github.io/1.0/dev/git-commit-msg.html +- http://karma-runner.github.io/1.0/dev/git-commit-msg.html \ No newline at end of file diff --git a/Test/Test.psm1 b/Test/Test.psm1 index f667fac..3b358ed 100644 --- a/Test/Test.psm1 +++ b/Test/Test.psm1 @@ -10,4 +10,4 @@ $MODULE_PATH = $PSScriptRoot catch { Write-Error -Message "Failed to import $($import.fullname): $_" } } } -Export-ModuleMember -Function Test_* +Export-ModuleMember -Function Test_* \ No newline at end of file diff --git a/include/config.ps1 b/include/config.ps1 index 87f8599..cc3207e 100644 --- a/include/config.ps1 +++ b/include/config.ps1 @@ -187,4 +187,4 @@ if( -not (Test-Path function:$destFunction )){ # Rename-Item -path Function:$function -NewName $destFunction Copy-Item -path Function:$function -Destination Function:$destFunction Export-ModuleMember -Function $destFunction -} +} \ No newline at end of file From aff11086a15acb3f4fa58517ad444ff9e6d714d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Wed, 4 Feb 2026 17:02:59 +0100 Subject: [PATCH 09/10] feat(runBeforeEach): add Reset_Test_Mock call to Run_BeforeEach function --- Test/public/run_BeforeAfter.ps1 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Test/public/run_BeforeAfter.ps1 b/Test/public/run_BeforeAfter.ps1 index 15439ee..0a1ebc7 100644 --- a/Test/public/run_BeforeAfter.ps1 +++ b/Test/public/run_BeforeAfter.ps1 @@ -6,20 +6,22 @@ # - Before all tests # - After all tests -function Run_BeforeAll{ - Write-Verbose "Run_BeforeAll" -} +# function Run_BeforeAll{ +# Write-Verbose "Run_BeforeAll" +# } -function Run_AfterAll{ - Write-Verbose "Run_AfterAll" -} +# function Run_AfterAll{ +# Write-Verbose "Run_AfterAll" +# } function Run_BeforeEach{ Write-Verbose "Run_BeforeEach" -} -function Run_AfterEach{ - Write-Verbose "Run_AfterEach" + Reset_Test_Mock } +# function Run_AfterEach{ +# Write-Verbose "Run_AfterEach" +# } + Export-ModuleMember -Function Run_* From 54b21c7a554db2393f6defc49eb74cc63040f035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20=28Dibildos=29=20Gonz=C3=A1lez?= Date: Wed, 4 Feb 2026 17:16:12 +0100 Subject: [PATCH 10/10] fix(Export-MyTranscript): change parameter type from string[] to object[] --- Test/include/transcriptHelp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/include/transcriptHelp.ps1 b/Test/include/transcriptHelp.ps1 index 892d25e..5ab9dcd 100644 --- a/Test/include/transcriptHelp.ps1 +++ b/Test/include/transcriptHelp.ps1 @@ -32,7 +32,7 @@ function Export-MyTranscript { [CmdletBinding()] param ( [Parameter(Mandatory, Position = 0)] - [string[]]$transcriptContent + [object[]]$transcriptContent ) $i = 0..($transcriptContent.Count - 1) | Where-Object { $transcriptContent[$_] -eq "**********************" }