From 4d444681a34cef6b1102d36e2cf06664e6b20edf Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Fri, 15 May 2026 15:46:23 -0700 Subject: [PATCH] =?UTF-8?q?refactor(tests):=20=F0=9F=94=A7=20Update=20test?= =?UTF-8?q?=20setup=20to=20use=20build=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Replaced `Set-BuildEnvironment` with a call to the build script in multiple test files. * This change standardizes the test environment setup across all test cases. * Allows easier testing with the Testing VS Code tool. --- Tests/Chocolatey.Type.Tests.ps1 | 2 +- Tests/Command.Type.Tests.ps1 | 2 +- Tests/DotnetSdk.Type.Tests.ps1 | 2 +- Tests/FileDownload.Type.Tests.ps1 | 2 +- Tests/FileSystem.Type.Tests.ps1 | 2 +- Tests/Git.Type.Tests.ps1 | 2 +- Tests/GitHub.Type.Tests.ps1 | 2 +- Tests/Noop.Type.Tests.ps1 | 2 +- Tests/Npm.Type.Tests.ps1 | 2 +- Tests/Nuget.Type.Tests.ps1 | 2 +- Tests/PSGalleryModule.Type.Tests.ps1 | 2 +- Tests/PSGalleryNuget.Type.Tests.ps1 | 2 +- Tests/Package.Type.Tests.ps1 | 2 +- Tests/Task.Type.Tests.ps1 | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Tests/Chocolatey.Type.Tests.ps1 b/Tests/Chocolatey.Type.Tests.ps1 index 927e61d..f424582 100644 --- a/Tests/Chocolatey.Type.Tests.ps1 +++ b/Tests/Chocolatey.Type.Tests.ps1 @@ -7,7 +7,7 @@ BeforeDiscovery { BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Command.Type.Tests.ps1 b/Tests/Command.Type.Tests.ps1 index 8eb0c36..48b5b28 100644 --- a/Tests/Command.Type.Tests.ps1 +++ b/Tests/Command.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/DotnetSdk.Type.Tests.ps1 b/Tests/DotnetSdk.Type.Tests.ps1 index 9194802..4bbb92b 100644 --- a/Tests/DotnetSdk.Type.Tests.ps1 +++ b/Tests/DotnetSdk.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/FileDownload.Type.Tests.ps1 b/Tests/FileDownload.Type.Tests.ps1 index 6ad5135..e734878 100644 --- a/Tests/FileDownload.Type.Tests.ps1 +++ b/Tests/FileDownload.Type.Tests.ps1 @@ -7,7 +7,7 @@ BeforeDiscovery { BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/FileSystem.Type.Tests.ps1 b/Tests/FileSystem.Type.Tests.ps1 index 9df68a8..d69c212 100644 --- a/Tests/FileSystem.Type.Tests.ps1 +++ b/Tests/FileSystem.Type.Tests.ps1 @@ -7,7 +7,7 @@ BeforeDiscovery { BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Git.Type.Tests.ps1 b/Tests/Git.Type.Tests.ps1 index 7f9a1a2..1cbef4b 100644 --- a/Tests/Git.Type.Tests.ps1 +++ b/Tests/Git.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/GitHub.Type.Tests.ps1 b/Tests/GitHub.Type.Tests.ps1 index 1954702..afd27c9 100644 --- a/Tests/GitHub.Type.Tests.ps1 +++ b/Tests/GitHub.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Noop.Type.Tests.ps1 b/Tests/Noop.Type.Tests.ps1 index 3c13a39..8bad1d4 100644 --- a/Tests/Noop.Type.Tests.ps1 +++ b/Tests/Noop.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Npm.Type.Tests.ps1 b/Tests/Npm.Type.Tests.ps1 index 2050ca0..9643a0d 100644 --- a/Tests/Npm.Type.Tests.ps1 +++ b/Tests/Npm.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Nuget.Type.Tests.ps1 b/Tests/Nuget.Type.Tests.ps1 index 2822918..f797bd1 100644 --- a/Tests/Nuget.Type.Tests.ps1 +++ b/Tests/Nuget.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/PSGalleryModule.Type.Tests.ps1 b/Tests/PSGalleryModule.Type.Tests.ps1 index 6a7603f..0da7cc9 100644 --- a/Tests/PSGalleryModule.Type.Tests.ps1 +++ b/Tests/PSGalleryModule.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/PSGalleryNuget.Type.Tests.ps1 b/Tests/PSGalleryNuget.Type.Tests.ps1 index cfe864a..c53c323 100644 --- a/Tests/PSGalleryNuget.Type.Tests.ps1 +++ b/Tests/PSGalleryNuget.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Package.Type.Tests.ps1 b/Tests/Package.Type.Tests.ps1 index a75d8c1..db8c2ef 100644 --- a/Tests/Package.Type.Tests.ps1 +++ b/Tests/Package.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force diff --git a/Tests/Task.Type.Tests.ps1 b/Tests/Task.Type.Tests.ps1 index 3dd3caa..17b0983 100644 --- a/Tests/Task.Type.Tests.ps1 +++ b/Tests/Task.Type.Tests.ps1 @@ -2,7 +2,7 @@ BeforeAll { if (-not $env:BHProjectPath) { - Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force + & "$PSScriptRoot\..\build.ps1" -Task 'Build' } Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force