Skip to content

Commit 314c6bf

Browse files
committed
Update MyModule.Tests.ps1
1 parent 6635128 commit 314c6bf

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/tests/MyModule.Tests.ps1

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@
33
# Requires Pester v5+
44

55
BeforeAll {
6-
# Set up test environment - use simple relative paths from repo root
7-
$script:ValidateScript = ".\Scripts\VALIDATE.ps1"
8-
$script:DeepCleanScript = ".\Scripts\DeepCleanPro.ps1"
6+
# Simple, direct paths that will work in CI
7+
# CI runs from repository root, so use paths relative to that
8+
$script:ValidateScript = Join-Path $PSScriptRoot "..\..\Scripts\VALIDATE.ps1" | Resolve-Path
9+
$script:DeepCleanScript = Join-Path $PSScriptRoot "..\..\Scripts\DeepCleanPro.ps1" | Resolve-Path
910

10-
# Debug output
11-
Write-Host "Looking for scripts at:" -ForegroundColor Yellow
12-
Write-Host " VALIDATE.ps1: $script:ValidateScript (Exists: $(Test-Path $script:ValidateScript))" -ForegroundColor Cyan
13-
Write-Host " DeepCleanPro.ps1: $script:DeepCleanScript (Exists: $(Test-Path $script:DeepCleanScript))" -ForegroundColor Cyan
11+
# Fallback if Resolve-Path fails
12+
if (-not $script:ValidateScript) {
13+
$script:ValidateScript = ".\Scripts\VALIDATE.ps1"
14+
}
15+
if (-not $script:DeepCleanScript) {
16+
$script:DeepCleanScript = ".\Scripts\DeepCleanPro.ps1"
17+
}
1418

1519
# Mock data
1620
$script:TestTempPath = Join-Path $env:TEMP "PesterTest_$(Get-Random)"
21+
22+
# Output for debugging
23+
Write-Host "Test paths resolved to:" -ForegroundColor Yellow
24+
Write-Host " VALIDATE: $script:ValidateScript" -ForegroundColor Cyan
25+
Write-Host " DeepClean: $script:DeepCleanScript" -ForegroundColor Cyan
1726
}
1827

1928
AfterAll {

0 commit comments

Comments
 (0)