From 2b7c162f0bbbb6e70421574418d1fab94598a935 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 07:19:43 +0100 Subject: [PATCH 01/13] refactor(TraceInvokeMock): make TraceInvokeFIlePath and invoke for mock --- Test/include/invokeCommand.mock.ps1 | 34 ++++++++++++++++++++----- Test/public/invokeCommand.mock.test.ps1 | 6 ++--- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Test/include/invokeCommand.mock.ps1 b/Test/include/invokeCommand.mock.ps1 index e10e6ca..1cc1fc8 100644 --- a/Test/include/invokeCommand.mock.ps1 +++ b/Test/include/invokeCommand.mock.ps1 @@ -3,8 +3,8 @@ # # This includes help commands to mock invokes in a test module # -# Set $env:TraceInvokeMockFilePath to trave Invoke dependencies -# "traceInvoke.log" | %{touch $_ ; $env:TraceInvokeMockFilePath = $_ | Resolve-Path} +# Set $env:TraceInvokeMock to trave Invoke dependencies +# "traceInvoke.log" | %{touch $_ ; $env:TraceInvokeMock = $_ | Resolve-Path} # # THIS INCLUDE REQURED module.helper.ps1 if(-not $MODULE_NAME){ throw "Missing MODULE_NAME varaible initialization. Check for module.helerp.ps1 file." } @@ -15,17 +15,30 @@ $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" +$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()] param( [Parameter(Mandatory,Position=0)][string]$Alias ) - $filePath = $env:TraceInvokeMockFilePath - - if(! $filePath){ return } + $filePath = Invoke-MyCommand -Command $TraceInvokeFilePathCommand if(! (Test-Path $filePath)) {return} @@ -35,7 +48,7 @@ function Trace-InvokeCommandAlias{ if($content.Contains($Alias)) { return} - $alias | Out-File $filePath -Append + $alias | Out-File $filePath -Append -Force } @@ -81,6 +94,8 @@ function MockCall{ Assert-MockFileNotfound $fileName + Trace-MockCommandFile -Command $command -Filename $filename + Set-InvokeCommandMock -Alias $command -Command "Get-MockFileContent -filename $filename" } @@ -92,6 +107,8 @@ function MockCallAsync{ Assert-MockFileNotfound $fileName + Trace-MockCommandFile -Command $command -Filename $filename + $moduleTest = $PSScriptRoot | Split-Path -Parent | Convert-Path Set-InvokeCommandMock -Alias $command -Command "Import-Module $moduleTest ; Get-MockFileContent -filename $filename" @@ -106,6 +123,9 @@ function MockCallJson{ ) Assert-MockFileNotfound $fileName + + Trace-MockCommandFile -Command $command -Filename $filename + $asHashTableString = $AsHashtable ? '$true' : '$false' $commandstr ='Get-MockFileContentJson -filename {filename} -AsHashtable:{asHashTableString}' @@ -124,6 +144,8 @@ function MockCallJsonAsync{ Assert-MockFileNotfound $fileName + Trace-MockCommandFile -Command $command -Filename $filename + $moduleTest = $PSScriptRoot | Split-Path -Parent | Convert-Path Set-InvokeCommandMock -Alias $command -Command "Import-Module $moduleTest ; Get-MockFileContentJson -filename $filename" diff --git a/Test/public/invokeCommand.mock.test.ps1 b/Test/public/invokeCommand.mock.test.ps1 index 48abf06..3830091 100644 --- a/Test/public/invokeCommand.mock.test.ps1 +++ b/Test/public/invokeCommand.mock.test.ps1 @@ -89,14 +89,14 @@ function Test_MockCallExpression{ function Test_TraceInvokeCOmmandAlias{ - $fileName = "traceInvoke.log" Assert-ItemNotExist -Path $fileName + $fileNamePath = Resolve-Path -Path "." | Join-Path -ChildPath $fileName + MockCallToString -Command "Invoke-IncludeHelperGetTraceInvokeFilePath" -OutString $fileNamePath + # Set flag touch $fileName - $fileNamePath = $fileName | Resolve-Path - $env:TraceInvokeMockFilePath = $fileNamePath Assert-ItemExist -Path $fileNamePath # Act record invoke alias From c4b576fa0505c0f95fc8e795755dfef4e5467f59 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 08:51:09 +0100 Subject: [PATCH 02/13] refactor(openFilesUrls): make Open-Url invoked --- include/openFilesUrls.ps1 | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/include/openFilesUrls.ps1 b/include/openFilesUrls.ps1 index 08ec43b..7306bc7 100644 --- a/include/openFilesUrls.ps1 +++ b/include/openFilesUrls.ps1 @@ -1,13 +1,17 @@ -function Open-Url { + +# Include openFilesUrls.ps1 +# Provides controls to open files and URLs in the default system applications. +# Use $MODULE_NAME variable to set up functions names + +Set-MyInvokeCommandAlias -Alias OpenUrl -Command "Invoke-$($MODULE_NAME)OpenUrl -Url {url}" + +function Invoke-ModuleNameOpenUrl{ [CmdletBinding()] - param ( - [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] - [ValidateNotNullOrEmpty()] - [string]$Url + param( + [Parameter(Mandatory = $true)][string]$Url ) - process { - try { + try { # Determine the operating system if ($IsWindows -or $env:OS -match "Windows") { # Windows - use Start-Process @@ -47,6 +51,21 @@ function Open-Url { catch { Write-Error "Failed to open URL: $_" } +} +Copy-Item -path Function:Invoke-ModuleNameOpenUrl -Destination Function:"Invoke-$($MODULE_NAME)OpenUrl" +Export-ModuleMember -Function "Invoke-$($MODULE_NAME)OpenUrl" + + +function Open-Url { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] + [ValidateNotNullOrEmpty()] + [string]$Url + ) + + process { + Invoke-MyCommand -Command OpenUrl -Parameters @{url = $Url} } } @@ -108,4 +127,4 @@ function Open-File { Write-Error "Failed to open file: $_" } } -} \ No newline at end of file +} From f3941fa2cc9e1af95226169bf81f567d3883bacb 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 08:53:11 +0100 Subject: [PATCH 03/13] feat(logging): add debug logging functionality to Write-MyDebug and related functions --- Test/include/InvokeMockList.ps1 | 48 +++++++++++++++++++++++++++ include/MyWrite.ps1 | 58 +++++++++++++++++++++++++++++++-- 2 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 Test/include/InvokeMockList.ps1 diff --git a/Test/include/InvokeMockList.ps1 b/Test/include/InvokeMockList.ps1 new file mode 100644 index 0000000..3c867a8 --- /dev/null +++ b/Test/include/InvokeMockList.ps1 @@ -0,0 +1,48 @@ + +$MockCommandFile = $testRootPath | Join-Path -ChildPath "mockfiles.log" + +function Trace-MockCommandFile{ + [CmdletBinding()] + param( + [string] $Command, + [string] $FileName + ) + + # read content + $content = readMockCommandFile + + # Check that the entry is already there + $result = $content | Where-Object{$_.command -eq $command} + if($null -ne $result) {return} + + # add entry + $new = @{ + Command = $command + FileName = $fileName + } + + $ret = @() + $ret += $content + $ret += $new + + # Save list + writeMockCommandFile -Content $ret +} + +function readMockCommandFile{ + $ret = Get-Content -Path $MockCommandFile | ConvertFrom-Json + + # return an empty aray if content does not exists + $ret = $ret ?? @() + + return $ret +} + +function writeMockCommandFile($Content){ + + $list = $Content | ConvertTo-Json + + $sorted = $list | Sort-Object fileName + + $sorted | Out-File -FilePath $MockCommandFile +} \ No newline at end of file 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 b99624bbba3e97916eac4cfa1b6a499fc0fdb647 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 08:57:16 +0100 Subject: [PATCH 04/13] refactor(.gitignore): clean up and organize ignore rules --- .gitignore | 647 ++++++++++++++++++++++++++--------------------------- 1 file changed, 323 insertions(+), 324 deletions(-) diff --git a/.gitignore b/.gitignore index acc8348..1c72bc5 100755 --- a/.gitignore +++ b/.gitignore @@ -1,324 +1,323 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ -**/Properties/launchSettings.json - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# TypeScript v1 declaration files -typings/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# TypeScript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog \ No newline at end of file From a65a8275ffea75d359e2196c6ae0ecfed22f0808 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 08:58:24 +0100 Subject: [PATCH 05/13] docs(copilot-instructions): update project overview and architecture details --- .github/copilot-instructions.md | 189 ++++++++++++++++++++++---------- 1 file changed, 129 insertions(+), 60 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b679dd4..e0ee098 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,84 +1,153 @@ -# Copilot Instructions for IncludeHelper +# ProjectHelper Copilot Instructions -IncludeHelper is a PowerShell module that provides shared utility functions and a framework for distributing reusable code components ("includes") across other modules. +## Project Overview +**ProjectHelper** is a PowerShell module for GitHub Projects interaction via GraphQL API. It provides CLI-like functions to manage GitHub projects, items, users, and collaborators from PowerShell. -## Architecture Overview +## Architecture & Core Patterns -**Module Structure:** -- `config/`: Configuration utilities and module initialization -- `helper/`: Core module helpers (module path resolution, folder management) -- `include/`: Shared utility functions (logging, API calls, database, config management) -- `private/`: Internal functions not exported -- `public/`: Exported functions (the public API) -- `Test/`: Mirrored structure with unit tests and mocks +### Module Structure +- **Loading Order** (`ProjectHelper.psm1`): `config` → `helper` → `include` → `private` → `public` +- **Public Functions**: Exported via `Export-ModuleMember -Function ` in each file +- **Private Functions**: In `/private` folder, not exported; used internally by public functions +- **Include Files** (`/include`): Shared utilities loaded early; example: `callAPI.ps1` (GraphQL/REST), `MyWrite.ps1` (logging) +- **Driver Functions** (`/public/driver`): Low-level integration with GitHub APIs; marked with comment "integration function not intended for direct user use" -**Loading Order** (in `IncludeHelper.psm1`): `config` → `helper` → `include` → `private` → `public` +### Key Files & Responsibilities +- `include/callAPI.ps1`: Handles `Invoke-GraphQL` and `Invoke-RestAPI` calls to GitHub +- `helper/invokeCommand.helper.ps1`: Provides `Invoke-MyCommand` for alias-based command dispatch (enables test mocking) +- `include/config.ps1`: Configuration storage in `~/.helpers/ProjectHelper/config/` +- `public/graphql/*.{query,mutant,tag}`: GraphQL template files (fragments and queries) +- `Test/Test.psd1`: Parallel test module with identical structure to main module -## PowerShell Function Conventions - -### All Functions -- Must include `[CmdletBinding()]` attribute -- Must include `param()` block (even if empty) -- Use proper script documentation with `<# .SYNOPSIS #>` blocks +### Invocation Pattern (Critical for Testing) +```powershell +# Production: Direct API calls +Invoke-GraphQL -Query $query -Variables $variables -### Public Functions (`public/` folder) -- Add `Export-ModuleMember -Function 'FunctionName'` on the closing `}` line -- Example: - ```powershell - function Add-IncludeToWorkspace { - [CmdletBinding()] - param([Parameter(Mandatory)][string]$Name) - # Logic - } Export-ModuleMember -Function 'Add-IncludeToWorkspace' - ``` +# High-level: Uses Invoke-MyCommand alias dispatch (mockable) +Invoke-MyCommand -Command "findProject" -Parameters @{owner=$Owner; pattern=$Pattern} -### Helper Functions (`helper/` folder) -- Available module-wide; follow naming convention: verbs that clearly indicate utility purpose -- Key helpers: `Find-ModuleRootPath`, `Get-ModuleFolder`, `Get-Ps1FullPath` +# Set custom implementation for testing/mocking: +Set-MyInvokeCommandAlias -Alias $alias -Command $Command +``` -## Logging and Debugging +## Development Workflows -- Use `MyWrite.ps1` functions: `Write-MyError`, `Write-MyWarning`, `Write-MyVerbose`, `Write-MyDebug`, `Write-MyHost` -- Control verbosity via environment variables: `$env:ModuleHelper_VERBOSE="all"` or specific function names -- Control debugging via `$env:ModuleHelper_DEBUG="all"` or specific sections -- Test verbosity/debug state with `Test-MyVerbose` and `Test-MyDebug` +### Running Tests +```powershell +./test.ps1 # Run all tests +./test.ps1 -ShowTestErrors # Show error details +./test.ps1 -TestName "Test_*" # Run specific test +``` -## Test Conventions +Uses **TestingHelper** module from PSGallery (installed automatically). -Tests use `TestingHelper` module and follow pattern: `function Test_FunctionName_Scenario` +### Building & Deploying +```powershell +./build.ps1 # Build module +./deploy.ps1 -VersionTag "v1.0.0" # Deploy to PSGallery +./sync.ps1 # Sync with TestingHelper templates +``` -**Test Structure:** +### Debugging +Enable module debug output: ```powershell -function Test_AddIncludeToWorkspace { - # Arrange - Setup test data and mocks - Import-Module -Name TestingHelper - New-ModuleV3 -Name TestModule +Enable-ProjectHelperDebug +Disable-ProjectHelperDebug +``` - # Act - Execute the function being tested - Add-IncludeToWorkspace -Name "getHashCode.ps1" -FolderName "Include" -DestinationModulePath "TestModule" +## Code Patterns & Conventions - # Assert - Verify results - Assert-ItemExist -path (Join-Path $folderPath "getHashCode.ps1") -} +### GraphQL Integration +1. Store GraphQL in template files: `/public/graphql/queryName.query` or `.mutant` +2. Retrieve via: `Get-GraphQLString "queryName.query"` +3. Execute: `Invoke-GraphQL -Query $query -Variables $variables` + +Example: +```powershell +$query = Get-GraphQLString "findProject.query" +$variables = @{ login = $Owner; pattern = $Pattern } +$response = Invoke-GraphQL -Query $query -Variables $variables ``` -- Use `Assert-NotImplemented` for unfinished tests -- Test files in `Test/public/` mirror functions in `public/` -- Run tests with `./test.ps1` (uses `TestingHelper` module) +### Public vs. Private Functions +- **Public** (`/public`): User-facing, high-level; transform data, handle caching +- **Private** (`/private`): Lower-level helpers; return raw GitHub data +- **Driver** (`/public/driver`): Thin wrappers around API calls; minimal logic -## Core Patterns +### Command Aliases with Parameter Templates +Use `Set-MyInvokeCommandAlias` for dynamic command dispatch: +```powershell +Set-MyInvokeCommandAlias -Alias "findProject" -Command "Invoke-FindProject -Owner {owner} -Pattern {pattern}" +Invoke-MyCommand -Command "findProject" -Parameters @{owner="foo"; pattern="bar"} +``` +This enables mocking in tests without changing implementation. -**Module Discovery:** Use `Find-ModuleRootPath` to locate module root by searching up from current path for `*.psd1` files (skips Test.psd1). +### Pipeline & Object Transformation +Functions support pipeline input for bulk operations: +```powershell +"user1", "user2" | Add-ProjectUser -Owner $owner -ProjectNumber 123 -Role "WRITER" +``` -**Folder Management:** `Get-ModuleFolder` maps logical names (`Include`, `Public`, `TestPrivate`, etc.) to filesystem paths. Valid names defined in `helper/module.helper.ps1` `$VALID_FOLDER_NAMES`. +### Error Handling +- GraphQL errors: Check `$response.errors` before processing +- Include meaningful context in error messages +- Use `Write-MyError`, `Write-MyVerbose`, `Write-MyDebug` for consistent logging + +## Testing Patterns + +### Test File Location +Test files must mirror the module structure: +- **Source**: `public/code.ps1` → **Test**: `Test/public/code.test.ps1` +- **Source**: `public/driver/invoke-getnode.ps1` → **Test**: `Test/public/driver/invoke-getnode.test.ps1` +- **Source**: `private/dates.ps1` → **Test**: `Test/private/dates.test.ps1` + +The folder structure in `Test/` must exactly match the structure in the main module. + +### Test Function Naming +- **Format**: `Test__` +- **Examples**: + - `Test_FindProject_SUCCESS` (success case) + - `Test_AddProjectUser_SUCCESS_SingleUser` (specific variant) + - `Test_GetProjectIssue_NotFound` (error case) +- **Conventions**: + - Use PascalCase matching the actual function name (e.g., `Get-SomeInfo` → `Test_GetSomeInfo_`) + - `` should be a descriptive word indicating the test goal (SUCCESS, NotFound, InvalidInput, etc.) + - Use assertions: `Assert-IsTrue`, `Assert-Contains`, `Assert-AreEqual`, `Assert-Count`, `Assert-IsNull` + +### Mock System +Located in `Test/include/`: +- `invokeCommand.mock.ps1`: Mocks `Invoke-MyCommand` calls via JSON files in `Test/private/mocks/` +- `callPrivateContext.ps1`: Execute private functions in module context + +### Mock Data Structure +```powershell +# Test/private/mocks/mockCommands.json defines: +{ + "Command": "Invoke-GetUser -Handle rulasg", + "FileName": "invoke-GetUser-rulasg.json" +} +``` -**Configuration:** JSON-based, stored in `~/.helpers/{ModuleName}/config/`. Use `Get-Configuration`, `Save-Configuration`, `Test-Configuration` from `include/config.ps1`. +### Common Test Setup +```powershell +Reset-InvokeCommandMock +Mock_DatabaseRoot +MockCall_GetProject $project -SkipItems +MockCallJson -Command "command" -File "response.json" +``` -**Command Aliasing:** Use `Set-MyInvokeCommandAlias` and `Invoke-MyCommand` for mockable external commands (database calls, API invocations). +## Key Dependencies +- **GitHub API**: GraphQL (primary), REST (legacy) +- **TestingHelper**: Test framework from PSGallery +- **InvokeHelper**: Command dispatch/mocking library (external) -## Development Commands +## Important Gotchas +1. **Module Loading**: Functions depend on proper load order; new files in `/private` or `/public` auto-loaded +2. **Aliases**: Use `Set-MyInvokeCommandAlias` before calling `Invoke-MyCommand` for consistency +3. **GraphQL Templates**: Fragment files (`.tag`) must match schema; test with actual GitHub API responses +4. **Configuration**: Stored per-module; reset with `Reset-ProjectHelperEnvironment` +5. **PSScriptAnalyzer**: PR checks fail on warnings; review `.github/workflows/powershell.yml` rules -- `./test.ps1` - Run all unit tests -- `./sync.ps1` - Sync includes to workspace/module -- `./deploy.ps1` - Deploy module -- `./release.ps1` - Release module version +## PR Branch & Active Work +Currently on `projectv2ContributionUpdate` - Implementing project access management with new user collaboration features. Recent changes focus on `Invoke-UpdateProjectV2Collaborators` and `Add-ProjectUser` functions with proper string splitting via `-split` with `[System.StringSplitOptions]::RemoveEmptyEntries`. From 966b9469488cccb6d35f7fc242ad982eb38d8077 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 09:00:16 +0100 Subject: [PATCH 06/13] feat(tests): Move testing loggic from test.ps1 to module tools/Test_Helper --- .../workflows/deploy_module_on_release.yml | 30 ++++- .github/workflows/test_with_TestingHelper.yml | 9 +- .vscode/settings.json | 9 +- test.ps1 | 115 +----------------- .../Test_Helper/public/Get-RequiredModule.ps1 | 27 ++++ .../public/Import-RequiredModule.ps1 | 59 +++++++++ tools/Test_Helper/public/testResults.ps1 | 28 +++++ tools/Test_Helper/public/testname.ps1 | 37 ++++++ 8 files changed, 186 insertions(+), 128 deletions(-) create mode 100644 tools/Test_Helper/public/Get-RequiredModule.ps1 create mode 100644 tools/Test_Helper/public/Import-RequiredModule.ps1 create mode 100644 tools/Test_Helper/public/testResults.ps1 create mode 100644 tools/Test_Helper/public/testname.ps1 diff --git a/.github/workflows/deploy_module_on_release.yml b/.github/workflows/deploy_module_on_release.yml index 70da980..9a2a58c 100644 --- a/.github/workflows/deploy_module_on_release.yml +++ b/.github/workflows/deploy_module_on_release.yml @@ -19,6 +19,22 @@ jobs: run: | echo $EVENT_CONTEXT + - name: Run test.ps1 + shell: pwsh + run: | + $result = ./test.ps1 -ShowTestErrors + + Write-Output $result + + import-module ./tools/Test_Helper/ + + $passed = Test-Result -Result $result + + if($passed) + { "All test passed" | Write-Verbose -verbose ; exit 0 } + else + { "Not all tests passed" | Write-Verbose -verbose ; exit 1 } + - name: deploy_ps1 shell: pwsh env: @@ -27,8 +43,16 @@ jobs: RELEASE_TAG: ${{ github.event.release.tag_name }} RELEASE_NAME: ${{ github.event.release.name }} run: | - $env:EVENT_REF = $env:REF + # Import required modules for deployment + import-module ./tools/Test_Helper/ + + Get-RequiredModule -Verbose | Import-RequiredModule -AllowPrerelease + + # GET TAG NAME + + ## Ref definition. Branch or Tag + $env:EVENT_REF = $env:REF If ([string]::IsNullOrEmpty($env:EVENT_REF)) { # Release published trigger $tag = $env:RELEASE_TAG @@ -41,8 +65,8 @@ jobs: If([string]::IsNullorwhitespace($tag)) { # Tag name is empty, exit - write-error "Tag name is empty" - exit 1 + throw "Tag name is empty" } + # DEPLOYMENT ./deploy.ps1 -VersionTag $tag -NugetApiKey $env:NUGETAPIKEY diff --git a/.github/workflows/test_with_TestingHelper.yml b/.github/workflows/test_with_TestingHelper.yml index 8039700..a11f66f 100644 --- a/.github/workflows/test_with_TestingHelper.yml +++ b/.github/workflows/test_with_TestingHelper.yml @@ -33,11 +33,12 @@ jobs: shell: pwsh run: | $result = ./test.ps1 -ShowTestErrors - $result - # Allow Not Implemented and Skipped tests to pass - $passed = $result.Tests -eq $result.Pass + $result.NotImplemented + $result.Skipped - # $passed = $result.Tests -eq $result.Pass + Write-Output $result + + import-module ./tools/Test_Helper/ + + $passed = Test-Result -Result $result if($passed) { "All test passed" | Write-Verbose -verbose ; exit 0 } diff --git a/.vscode/settings.json b/.vscode/settings.json index 1d9904e..7a73a41 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,2 @@ { - "terminal.integrated.profiles.osx": { - "pwsh": { - "path": "pwsh", - "icon": "terminal-powershell", - "args": ["-NoExit", "-Command", "if (Test-Path './tools/Test_Helper') { Import-Module './tools/Test_Helper' -Force }"] - } - } -} +} \ No newline at end of file diff --git a/test.ps1 b/test.ps1 index b1d497a..ff29167 100644 --- a/test.ps1 +++ b/test.ps1 @@ -18,121 +18,10 @@ param ( [Parameter()][string]$TestName ) -function Set-TestName{ - [CmdletBinding()] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function')] - [Alias("st")] - param ( - [Parameter(Position=0,ValueFromPipeline)][string]$TestName - ) - - process{ - $global:TestNameVar = $TestName - } -} - -function Get-TestName{ - [CmdletBinding()] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] - [Alias("gt")] - param ( - ) - - process{ - $global:TestNameVar - } -} - -function Clear-TestName{ - [CmdletBinding()] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] - [Alias("ct")] - param ( - ) - - $global:TestNameVar = $null -} - -function Import-RequiredModule{ - [CmdletBinding()] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Scope='Function')] - param ( - [Parameter(ParameterSetName = "HT", ValueFromPipeline)][hashtable]$RequiredModule, - [Parameter(ParameterSetName = "RM",Position = 0)][string]$ModuleName, - [Parameter(ParameterSetName = "RM")][string]$ModuleVersion, - [Parameter(ParameterSetName = "HT")] - [Parameter(ParameterSetName = "RM")] - [switch]$AllowPrerelease, - [Parameter(ParameterSetName = "HT")] - [Parameter(ParameterSetName = "RM")] - [switch]$PassThru - ) - - process{ - # Powershell module manifest does not allow versions with prerelease tags on them. - # Powershell modle manifest does not allow to add a arbitrary field to specify prerelease versions. - # Valid value (ModuleName, ModuleVersion, RequiredVersion, GUID) - # There is no way to specify a prerelease required module. - - if($RequiredModule){ - $ModuleName = $RequiredModule.ModuleName - $ModuleVersion = [string]::IsNullOrWhiteSpace($RequiredModule.RequiredVersion) ? $RequiredModule.ModuleVersion : $RequiredModule.RequiredVersion - } - - "Importing module Name[{0}] Version[{1}] AllowPrerelease[{2}]" -f $ModuleName, $ModuleVersion, $AllowPrerelease | Write-Verbose - - # Following semVer we can manually specidy a taged version to specify that is prerelease - # Extract the semVer from it and set AllowPrerelease to true - if ($ModuleVersion) { - $V = $ModuleVersion.Split('-') - $semVer = $V[0] - $AllowPrerelease = ($AllowPrerelease -or ($null -ne $V[1])) - } - - $module = Import-Module $ModuleName -PassThru -ErrorAction SilentlyContinue -MinimumVersion:$semVer - - if ($null -eq $module) { - "Installing module Name[{0}] Version[{1}] AllowPrerelease[{2}]" -f $ModuleName, $ModuleVersion, $AllowPrerelease | Write-Host -ForegroundColor DarkGray - $installed = Install-Module -Name $ModuleName -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$ModuleVersion - $module = $installed | ForEach-Object {Import-Module -Name $_.Name -RequiredVersion ($_.Version.Split('-')[0]) -Force -PassThru} - } - - "Imported module Name[{0}] Version[{1}] PreRelease[{2}]" -f $module.Name, $module.Version, $module.privatedata.psdata.prerelease | Write-Host -ForegroundColor DarkGray - - if ($PassThru) { - $module - } - } -} - -<# -. SYNOPSIS - Extracts the required modules from the module manifest -#> -function Get-RequiredModule{ - [CmdletBinding()] - [OutputType([Object[]])] - param() - - # Required Modules - $localPath = $PSScriptRoot - $manifest = $localPath | Join-Path -child "*.psd1" | Get-Item | Import-PowerShellDataFile - $requiredModule = $null -eq $manifest.RequiredModules ? @() : $manifest.RequiredModules - - # Convert to hashtable - $ret = @() - $requiredModule | ForEach-Object{ - $ret += $_ -is [string] ? @{ ModuleName = $_ } : $_ - } - - return $ret -} +# Load Test_Helper module +Import-Module ./tools/Test_Helper # Install and load TestingHelper -# Import-RequiredModule -Name TestingHelper -AllowPrerelease Import-RequiredModule "TestingHelper" -AllowPrerelease # Install and Load Module dependencies diff --git a/tools/Test_Helper/public/Get-RequiredModule.ps1 b/tools/Test_Helper/public/Get-RequiredModule.ps1 new file mode 100644 index 0000000..5370707 --- /dev/null +++ b/tools/Test_Helper/public/Get-RequiredModule.ps1 @@ -0,0 +1,27 @@ +<# +. SYNOPSIS + Extracts the required modules from the module manifest +#> +function Get-RequiredModule{ + [CmdletBinding()] + [OutputType([object[]])] + param( + # Path + [Parameter()][string]$Path = '.' + ) + + # Required Modules + $manifest = $Path | Join-Path -child "*.psd1" | Get-Item | Import-PowerShellDataFile + $requiredModule = $null -eq $manifest.RequiredModules ? @() : $manifest.RequiredModules + + "Found RequiredModules: $($requiredModule.Count)" | Write-Host -ForegroundColor DarkGray + + # Convert to hashtable + $requiredModule | ForEach-Object{ + "Processing RequiredModule: $($_| convertto-json -Depth 5)" | Write-Host -ForegroundColor DarkGray + $hashtable = $_ -is [string] ? @{ ModuleName = $_ } : $_ + + return [pscustomobject]$hashtable + } + +} Export-ModuleMember -Function Get-RequiredModule \ No newline at end of file diff --git a/tools/Test_Helper/public/Import-RequiredModule.ps1 b/tools/Test_Helper/public/Import-RequiredModule.ps1 new file mode 100644 index 0000000..0a50302 --- /dev/null +++ b/tools/Test_Helper/public/Import-RequiredModule.ps1 @@ -0,0 +1,59 @@ +<# +.SYNOPSIS + Import required modules +.DESCRIPTION + Import required modules specified in a module manifest or by name/version + If the module is not installed it will be installed from PSGallery +#> + +function Import-RequiredModule{ + [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Scope='Function')] + param ( + [Parameter(ParameterSetName = "HT", ValueFromPipeline)][PsCustomObject]$RequiredModule, + [Parameter(ParameterSetName = "RM",Position = 0)][string]$ModuleName, + [Parameter(ParameterSetName = "RM")][string]$ModuleVersion, + [Parameter(ParameterSetName = "HT")] + [Parameter(ParameterSetName = "RM")] + [switch]$AllowPrerelease, + [Parameter(ParameterSetName = "HT")] + [Parameter(ParameterSetName = "RM")] + [switch]$PassThru + ) + + process{ + # Powershell module manifest does not allow versions with prerelease tags on them. + # Powershell modle manifest does not allow to add a arbitrary field to specify prerelease versions. + # Valid value (ModuleName, ModuleVersion, RequiredVersion, GUID) + # There is no way to specify a prerelease required module. + + if($RequiredModule){ + $ModuleName = $RequiredModule.ModuleName + $ModuleVersion = [string]::IsNullOrWhiteSpace($RequiredModule.RequiredVersion) ? $RequiredModule.ModuleVersion : $RequiredModule.RequiredVersion + } + + "Importing module Name[{0}] Version[{1}] AllowPrerelease[{2}]" -f $ModuleName, $ModuleVersion, $AllowPrerelease | Write-Verbose + + # Following semVer we can manually specidy a taged version to specify that is prerelease + # Extract the semVer from it and set AllowPrerelease to true + if ($ModuleVersion) { + $V = $ModuleVersion.Split('-') + $semVer = $V[0] + $AllowPrerelease = ($AllowPrerelease -or ($null -ne $V[1])) + } + + $module = Import-Module $ModuleName -PassThru -ErrorAction SilentlyContinue -MinimumVersion:$semVer + + if ($null -eq $module) { + "Installing module Name[{0}] Version[{1}] AllowPrerelease[{2}]" -f $ModuleName, $ModuleVersion, $AllowPrerelease | Write-Host -ForegroundColor DarkGray + $installed = Install-Module -Name $ModuleName -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$ModuleVersion + $module = $installed | ForEach-Object {Import-Module -Name $_.Name -RequiredVersion ($_.Version.Split('-')[0]) -Force -PassThru} + } + + "Imported module Name[{0}] Version[{1}] PreRelease[{2}]" -f $module.Name, $module.Version, $module.privatedata.psdata.prerelease | Write-Host -ForegroundColor DarkGray + + if ($PassThru) { + $module + } + } +} Export-ModuleMember -Function Import-RequiredModule diff --git a/tools/Test_Helper/public/testResults.ps1 b/tools/Test_Helper/public/testResults.ps1 new file mode 100644 index 0000000..ef5c9e3 --- /dev/null +++ b/tools/Test_Helper/public/testResults.ps1 @@ -0,0 +1,28 @@ +function Test-Result{ + [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] + [OutputType([bool])] + param( + [Parameter(ValueFromPipeline)][object]$Result, + [Parameter()][switch]$SkippedNotAllowed, + [Parameter()][switch]$NotImplementedNotAllowed + ) + + process{ + # Chek results from last run + $Result = $Result ?? $Global:ResultTestingHelper + + if($SkippedNotAllowed -and $Result.Skipped -gt 0){ + return $false + } + + if($NotImplementedNotAllowed -and $Result.NotImplemented -gt 0){ + return $false + } + + # Allow Not Implemented and Skipped tests to pass + $passed = $Result.Tests -eq $Result.Pass + $Result.NotImplemented + $Result.Skipped + + return $passed + } +} Export-ModuleMember -Function Test-Result diff --git a/tools/Test_Helper/public/testname.ps1 b/tools/Test_Helper/public/testname.ps1 new file mode 100644 index 0000000..0a8ca0b --- /dev/null +++ b/tools/Test_Helper/public/testname.ps1 @@ -0,0 +1,37 @@ +function Set-TestName{ + [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function')] + [Alias("st")] + param ( + [Parameter(Position=0,ValueFromPipeline)][string]$TestName + ) + + process{ + $global:TestNameVar = $TestName + } +} Export-ModuleMember -Function Set-TestName -Alias st + +function Get-TestName{ + [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] + [Alias("gt")] + param ( + ) + + process{ + $global:TestNameVar + } +} Export-ModuleMember -Function Get-TestName -Alias gt + +function Clear-TestName{ + [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] + [Alias("ct")] + param ( + ) + + $global:TestNameVar = $null +} Export-ModuleMember -Function Clear-TestName -Alias ct \ No newline at end of file From 0db106244bb9fe1ed549c3a233cfba50d26100d9 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 10:15:07 +0100 Subject: [PATCH 07/13] refactor(tests): reorganize expected lists and system folder handling in test scripts --- Test/public/listIncludes.test.ps1 | 77 +++++++++++++++++++++++++------ public/listSystemFiles.ps1 | 20 +------- 2 files changed, 66 insertions(+), 31 deletions(-) diff --git a/Test/public/listIncludes.test.ps1 b/Test/public/listIncludes.test.ps1 index d5378e4..606272b 100644 --- a/Test/public/listIncludes.test.ps1 +++ b/Test/public/listIncludes.test.ps1 @@ -5,7 +5,9 @@ function Test_GetIncludeFile{ $includelist =@() - @("Include","TestInclude","Helper","TestHelper") | ForEach-Object{ + $expectedList = @("Include","TestInclude","Helper","TestHelper") + + $expectedList| ForEach-Object{ $includelist += Get-ModuleFolder -FolderName $_ | Get-ChildItem -File } @@ -34,33 +36,82 @@ function Test_GetIncludeSystemFiles { # Test for IncludeSystemFiles $expectedList = @( + + # Root @{ FolderName = "Root" ; Name = "{modulename}.psm1" } @{ FolderName = "Root" ; Name = "deploy.ps1" } @{ FolderName = "Root" ; Name = "LICENSE" } @{ FolderName = "Root" ; Name = "release.ps1" } @{ FolderName = "Root" ; Name = "sync.ps1" } @{ FolderName = "Root" ; Name = "test.ps1" } - @{ FolderName = "DevContainer" ; Name = "devcontainer.json" } - @{ FolderName = "GitHub" ; Name = "copilot-commit-message-instructions.md" } - @{ FolderName = "GitHub" ; Name = "copilot-instructions.md" } - @{ FolderName = "GitHub" ; Name = "copilot-pull-request-description-instructions.md" } - @{ FolderName = "TestHelperRoot" ; Name = "Test_Helper.psd1" } - @{ FolderName = "TestHelperRoot" ; Name = "Test_Helper.psm1" } - @{ FolderName = "TestHelperPublic" ; Name = "Get-RequiredModule.ps1" } - @{ FolderName = "TestHelperPublic" ; Name = "Import-RequiredModule.ps1" } - @{ FolderName = "TestHelperPublic" ; Name = "testname.ps1" } - @{ FolderName = "TestHelperPublic" ; Name = "testResults.ps1" } + + # Tools @{ FolderName = "Tools" ; Name = "deploy.Helper.ps1" } @{ FolderName = "Tools" ; Name = "sync.Helper.ps1" } + + # TestRoot @{ FolderName = "TestRoot" ; Name = "Test.psm1" } + + # Workflows @{ FolderName = "WorkFlows" ; Name = "deploy_module_on_release.yml" } @{ FolderName = "WorkFlows" ; Name = "powershell.yml" } @{ FolderName = "WorkFlows" ; Name = "test_with_TestingHelper.yml" } - @{ FolderName = "VsCode" ; Name = "settings.json" } - @{ FolderName = "VsCode" ; Name = "launch.json" } + + # @{ FolderName = "DevContainer" ; Name = "devcontainer.json" } + + # @{ FolderName = "GitHub" ; Name = "copilot-commit-message-instructions.md" } + # @{ FolderName = "GitHub" ; Name = "copilot-instructions.md" } + # @{ FolderName = "GitHub" ; Name = "copilot-pull-request-description-instructions.md" } + + # @{ FolderName = "TestHelperRoot" ; Name = "Test_Helper.psd1" } + # @{ FolderName = "TestHelperRoot" ; Name = "Test_Helper.psm1" } + + # @{ FolderName = "TestHelperPublic" ; Name = "Get-RequiredModule.ps1" } + # @{ FolderName = "TestHelperPublic" ; Name = "Import-RequiredModule.ps1" } + # @{ FolderName = "TestHelperPublic" ; Name = "testname.ps1" } + # @{ FolderName = "TestHelperPublic" ; Name = "testResults.ps1" } + + # @{ FolderName = "VsCode" ; Name = "settings.json" } + # @{ FolderName = "VsCode" ; Name = "launch.json" } ) + $systemFolders = @( + # 'Root', + # 'Include', + 'DevContainer', + # 'WorkFlows', + 'GitHub', + # 'Config', + # 'Helper', + # 'Private', + # 'Public', + # 'Tools', + + # 'TestRoot', + # 'TestConfig' + # 'TestInclude', + # 'TestHelper', + # 'TestPrivate', + # 'TestPublic', + + # "TestHelperRoot", + "TestHelperPrivate", + "TestHelperPublic", + + "VsCode" + ) + + # Add files from foldes that more files + foreach($folderName in $systemFolders){ + $folder = Get-ModuleFolder -FolderName $folderName + + $files = $folder | Get-ChildItem -File + foreach($file in $files){ + $expectedList += @{ FolderName = $folderName ; Name = $file.Name } + } + } + # Act $result = Get-IncludeSystemFiles diff --git a/public/listSystemFiles.ps1 b/public/listSystemFiles.ps1 index 2404016..23db0a7 100644 --- a/public/listSystemFiles.ps1 +++ b/public/listSystemFiles.ps1 @@ -26,12 +26,11 @@ function Get-IncludeSystemFiles{ # 'TestPrivate', # 'TestPublic', - "TestHelperRoot", + # "TestHelperRoot", "TestHelperPrivate", "TestHelperPublic", "VsCode" - ) $includeItems = @() @@ -40,6 +39,7 @@ function Get-IncludeSystemFiles{ $includeItems += Get-IncludeFile -Folders $systemFolders -Local:$Local # Root + $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = '{modulename}.psm1' } $includeItems += Get-IncludeFile -Local:$Local -Folders "Root" -Filter 'deploy.ps1' $includeItems += Get-IncludeFile -Local:$Local -Folders "Root" -Filter 'LICENSE' $includeItems += Get-IncludeFile -Local:$Local -Folders "Root" -Filter 'release.ps1' @@ -59,22 +59,6 @@ function Get-IncludeSystemFiles{ $includeItems += Get-IncludeFile -Local:$Local -Folders "WorkFlows" -Filter 'powershell.yml' $includeItems += Get-IncludeFile -Local:$Local -Folders "WorkFlows" -Filter 'test_with_TestingHelper.yml' - # Root - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = 'deploy.ps1' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = 'LICENSE' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = '{modulename}.psd1' } - $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = '{modulename}.psm1' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = 'release.ps1' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = 'sync.ps1' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Root') ; Name = 'test.ps1' } - - # # Tools - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Tools') ; Name = 'deploy.Helper.ps1' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'Tools') ; Name = 'sync.Helper.ps1' } - - # TestRoot - # #$includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'TestRoot') ; Name = 'Test.psd1' } - # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'TestRoot') ; Name = 'Test.psm1' } # # TestHelperRoot # $includeItems += [PSCustomObject]@{ FolderName = $(Get-Folder 'TestHelperRoot') ; Name = 'Test_Helper.psd1' } From c116f6b0a8d1cef400ee08c3e0e5e98817fdb44e 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 10:31:34 +0000 Subject: [PATCH 08/13] fix(tests): skip non-existent folders in Test_GetIncludeSystemFiles --- Test/public/listIncludes.test.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Test/public/listIncludes.test.ps1 b/Test/public/listIncludes.test.ps1 index 606272b..07dce70 100644 --- a/Test/public/listIncludes.test.ps1 +++ b/Test/public/listIncludes.test.ps1 @@ -106,6 +106,10 @@ function Test_GetIncludeSystemFiles { foreach($folderName in $systemFolders){ $folder = Get-ModuleFolder -FolderName $folderName + # Skipp if folder does not exist + if(-not $($folder | Test-Path)){ continue } + + # Add files that exist in the folder $files = $folder | Get-ChildItem -File foreach($file in $files){ $expectedList += @{ FolderName = $folderName ; Name = $file.Name } From 9ab9cb90296d16dfc0d8e30850040fae8a2ab4d9 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 11:56:07 +0100 Subject: [PATCH 09/13] refactor(tests): improve readMockCommandFile function to ensure empty list return for non-existent file --- 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 daea2b36b8d30cbd6cf1c2584d37eab6f6dc525b 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 12:01:01 +0100 Subject: [PATCH 10/13] style(tests): remove trailing whitespace and fix formatting in test files --- Test/include/invokeCommand.mock.ps1 | 4 ++-- Test/public/listIncludes.test.ps1 | 14 +++++++------- .../public/Remove-TailSpacesAndLines.test.ps1 | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Test/include/invokeCommand.mock.ps1 b/Test/include/invokeCommand.mock.ps1 index 1cc1fc8..5f3b13f 100644 --- a/Test/include/invokeCommand.mock.ps1 +++ b/Test/include/invokeCommand.mock.ps1 @@ -27,7 +27,7 @@ function Invoke-ModuleNameGetTraceInvokeFilePath{ $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 @@ -303,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 diff --git a/Test/public/listIncludes.test.ps1 b/Test/public/listIncludes.test.ps1 index 07dce70..e3f9330 100644 --- a/Test/public/listIncludes.test.ps1 +++ b/Test/public/listIncludes.test.ps1 @@ -5,8 +5,8 @@ function Test_GetIncludeFile{ $includelist =@() - $expectedList = @("Include","TestInclude","Helper","TestHelper") - + $expectedList = @("Include","TestInclude","Helper","TestHelper") + $expectedList| ForEach-Object{ $includelist += Get-ModuleFolder -FolderName $_ | Get-ChildItem -File } @@ -62,15 +62,15 @@ function Test_GetIncludeSystemFiles { # @{ FolderName = "GitHub" ; Name = "copilot-commit-message-instructions.md" } # @{ FolderName = "GitHub" ; Name = "copilot-instructions.md" } # @{ FolderName = "GitHub" ; Name = "copilot-pull-request-description-instructions.md" } - + # @{ FolderName = "TestHelperRoot" ; Name = "Test_Helper.psd1" } # @{ FolderName = "TestHelperRoot" ; Name = "Test_Helper.psm1" } - + # @{ FolderName = "TestHelperPublic" ; Name = "Get-RequiredModule.ps1" } # @{ FolderName = "TestHelperPublic" ; Name = "Import-RequiredModule.ps1" } # @{ FolderName = "TestHelperPublic" ; Name = "testname.ps1" } # @{ FolderName = "TestHelperPublic" ; Name = "testResults.ps1" } - + # @{ FolderName = "VsCode" ; Name = "settings.json" } # @{ FolderName = "VsCode" ; Name = "launch.json" } @@ -105,7 +105,7 @@ function Test_GetIncludeSystemFiles { # Add files from foldes that more files foreach($folderName in $systemFolders){ $folder = Get-ModuleFolder -FolderName $folderName - + # Skipp if folder does not exist if(-not $($folder | Test-Path)){ continue } @@ -138,4 +138,4 @@ function Assert-IncludeFile{ $item = $IncludesList | Where-Object {$_.Name -eq $Name} Assert-Count -Expected 1 -Presented $item Assert-AreEqual -Expected $FolderName -Presented $item.FolderName -Comment "Include File $Name should be in folder $FolderName" -} +} \ No newline at end of file diff --git a/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 b/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 index 54b482b..9ee296f 100644 --- a/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 +++ b/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 @@ -14,7 +14,7 @@ Line with no trailing spaces $content = @" Line with spaces - + Line with tabs Line with no trailing spaces @@ -168,4 +168,4 @@ function Assert-AreEqualFiles { return $true } -} +} \ No newline at end of file From e70aeba400c4aeda1b3345c81df9e1b53461d651 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 12:06:01 +0100 Subject: [PATCH 11/13] refactor(tests): add output logging for expected vs result in Test_GetIncludeSystemFiles --- Test/public/listIncludes.test.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Test/public/listIncludes.test.ps1 b/Test/public/listIncludes.test.ps1 index e3f9330..f5de17b 100644 --- a/Test/public/listIncludes.test.ps1 +++ b/Test/public/listIncludes.test.ps1 @@ -119,6 +119,12 @@ function Test_GetIncludeSystemFiles { # Act $result = Get-IncludeSystemFiles + Write-Host "Expected vs Result:" + $expectedList | ConvertTo-Json | Write-Host + + Write-Host "Result:" + $result | ConvertTo-Json | Write-Host + # Assert Assert-Count -Expected $expectedList.Count -Presented $result From 10a1834d8ad784882422303a1a2f4edbd83f95c2 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 12:29:08 +0100 Subject: [PATCH 12/13] refactor(tests): update expected content structure in Test_RemoveTrailingWhitespace --- .../public/Remove-TailSpacesAndLines.test.ps1 | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 b/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 index 9ee296f..7a7f2f9 100644 --- a/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 +++ b/Test/public/tools/Test_Helper/public/Remove-TailSpacesAndLines.test.ps1 @@ -1,28 +1,28 @@ function Test_RemoveTrailingWhitespace { Import-Test_Helper - - $Expected = @" - - Line with spaces - - Line with tabs - -Line with no trailing spaces -"@ - - $content = @" - - Line with spaces - - Line with tabs - -Line with no trailing spaces - - - -"@ - + # Build expected content line by line to avoid trailing whitespace being stripped + $expectedLines = @( + "" + " Line with spaces" + "" + " Line with tabs" + "" + "Line with no trailing spaces" + ) + $Expected = $expectedLines -join "`n" + + $contentLines = @( + " " + " Line with spaces" + " " + " Line with tabs" + " " + "Line with no trailing spaces" + "" + " " + ) + $content = $contentLines -join "`n" $presentedFile = New-TestingFile -Content $content -PassThru Assert-IsTrue -Condition (Test-TailEmptyLines -Path $presentedFile.FullName) From 509b1ac2ed0e43d947b08ae4a9fa958e878772a7 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 12:33:02 +0100 Subject: [PATCH 13/13] refactor(tests): remove debug output from Test_GetIncludeSystemFiles --- Test/public/listIncludes.test.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Test/public/listIncludes.test.ps1 b/Test/public/listIncludes.test.ps1 index f5de17b..e3f9330 100644 --- a/Test/public/listIncludes.test.ps1 +++ b/Test/public/listIncludes.test.ps1 @@ -119,12 +119,6 @@ function Test_GetIncludeSystemFiles { # Act $result = Get-IncludeSystemFiles - Write-Host "Expected vs Result:" - $expectedList | ConvertTo-Json | Write-Host - - Write-Host "Result:" - $result | ConvertTo-Json | Write-Host - # Assert Assert-Count -Expected $expectedList.Count -Presented $result