Skip to content

Commit 4e8ee13

Browse files
authored
Refactor Pester tests for OffsetInspect module
1 parent dfa4c23 commit 4e8ee13

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/OffsetInspect.Tests.ps1

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
# Basic Pester tests for OffsetInspect
22

3-
$root = Split-Path -Parent $PSScriptRoot
4-
$modulePath = Join-Path $root 'module'
5-
$manifest = Join-Path $modulePath 'OffsetInspect.psd1'
3+
# Repo root (parent of the tests folder)
4+
$root = Split-Path -Parent $PSScriptRoot
5+
$manifest = Join-Path $root 'OffsetInspect.psd1'
66

77
Describe 'OffsetInspect module manifest' {
88
It 'exists' {
9-
Test-Path $manifest | Should -BeTrue
9+
Test-Path -Path $manifest | Should -BeTrue
1010
}
1111
}
1212

1313
Describe 'OffsetInspect module import and exports' {
1414
It 'imports without error' {
15-
{ Import-Module $manifest -Force } | Should -Not -Throw
15+
{ Import-Module -Name $manifest -Force } | Should -Not -Throw
1616
}
1717

1818
It 'exports Invoke-OffsetInspect' {
19-
Import-Module $manifest -Force
20-
Get-Command Invoke-OffsetInspect -ErrorAction Stop | Should -Not -BeNullOrEmpty
19+
Import-Module -Name $manifest -Force
20+
Get-Command -Name Invoke-OffsetInspect -ErrorAction Stop |
21+
Should -Not -BeNullOrEmpty
2122
}
22-
}
23+
}

0 commit comments

Comments
 (0)