Skip to content

Commit 69c7bbd

Browse files
committed
refactor(tests): 🔧 Update test setup to use build script
* 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.
1 parent 864e03d commit 69c7bbd

14 files changed

Lines changed: 14 additions & 14 deletions

‎Tests/Chocolatey.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BeforeDiscovery {
77

88
BeforeAll {
99
if (-not $env:BHProjectPath) {
10-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
10+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
1111
}
1212
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
1313
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/Command.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/DotnetSdk.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/FileDownload.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BeforeDiscovery {
77

88
BeforeAll {
99
if (-not $env:BHProjectPath) {
10-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
10+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
1111
}
1212
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
1313
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/FileSystem.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BeforeDiscovery {
77

88
BeforeAll {
99
if (-not $env:BHProjectPath) {
10-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
10+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
1111
}
1212
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
1313
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/Git.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/GitHub.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/Noop.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/Npm.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

‎Tests/Nuget.Type.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BeforeAll {
44
if (-not $env:BHProjectPath) {
5-
Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force
5+
& "$PSScriptRoot\..\build.ps1" -Task 'Build'
66
}
77
Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue
88
Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force

0 commit comments

Comments
 (0)