Skip to content

Commit f30f681

Browse files
Use portable test setup paths
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent e643399 commit f30f681

16 files changed

Lines changed: 18 additions & 16 deletions

tests/Add-DomeneshopDnsRecord.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Add-DomeneshopDnsRecord' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

tests/Add-DomeneshopForward.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Add-DomeneshopForward' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

tests/Connect-DomeneshopAccount.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Connect-DomeneshopAccount' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

tests/Domeneshop.Private.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Domeneshop private helpers' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
It 'rejects a missing resolved context' {

tests/Domeneshop.TestSetup.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
[CmdletBinding()]
66
param()
77

8-
$functionFiles = Get-ChildItem -Path "$PSScriptRoot\..\src\functions" -Filter '*.ps1' -Recurse -File |
8+
$sourcePath = Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath 'src'
9+
$functionsPath = Join-Path -Path $sourcePath -ChildPath 'functions'
10+
$functionFiles = Get-ChildItem -Path $functionsPath -Filter '*.ps1' -Recurse -File |
911
Sort-Object -Property FullName
1012
foreach ($file in $functionFiles) {
1113
. $file.FullName

tests/Get-DomeneshopContext.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Get-DomeneshopContext' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
It 'gets the configured default context' {

tests/Get-DomeneshopDnsRecord.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Get-DomeneshopDnsRecord' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

tests/Get-DomeneshopDomain.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Get-DomeneshopDomain' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

tests/Get-DomeneshopForward.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Get-DomeneshopForward' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

tests/Get-DomeneshopInvoice.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param()
1313

1414
Describe 'Get-DomeneshopInvoice' {
1515
BeforeAll {
16-
. "$PSScriptRoot\Domeneshop.TestSetup.ps1"
16+
. (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1')
1717
}
1818

1919
BeforeEach {

0 commit comments

Comments
 (0)