Skip to content

Commit 9252e0a

Browse files
Copilotbergmeister
andauthored
Use provider paths for test selection
Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com>
1 parent 6a4cc32 commit 9252e0a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎Tests/Build/BuildModule.tests.ps1‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Describe "Build Module Tests" {
6060
$selectedPaths = @(Test-ScriptAnalyzer -InProcess -TestPath $testPath)
6161

6262
$selectedPaths.Count | Should -Be 1
63-
$selectedPaths[0] | Should -Be (Resolve-Path -LiteralPath $testPath).Path
63+
$selectedPaths[0] | Should -Be (Resolve-Path -LiteralPath $testPath).ProviderPath
6464
}
6565

6666
It "passes test paths containing apostrophes intact" {
@@ -70,7 +70,7 @@ Describe "Build Module Tests" {
7070
$selectedPaths = @(Test-ScriptAnalyzer -InProcess -TestPath $testPath)
7171

7272
$selectedPaths.Count | Should -Be 1
73-
$selectedPaths[0] | Should -Be (Resolve-Path -LiteralPath $testPath).Path
73+
$selectedPaths[0] | Should -Be (Resolve-Path -LiteralPath $testPath).ProviderPath
7474
}
7575

7676
It "fails when the supplied test path does not exist" {

‎build.psm1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ function Test-ScriptAnalyzer
320320
#
321321
$testModulePath = Join-Path "${projectRoot}" -ChildPath out
322322
if ($TestPath) {
323-
$resolvedTestPath = (Resolve-Path -LiteralPath $TestPath -ErrorAction Stop).Path
323+
$resolvedTestPath = (Resolve-Path -LiteralPath $TestPath -ErrorAction Stop).ProviderPath
324324
if ((Get-Item -LiteralPath $resolvedTestPath).PSIsContainer) {
325325
throw "TestPath must point to a test file."
326326
}

0 commit comments

Comments
 (0)