11# Pester tests for OffsetInspect module / manifest
22
3- # Repo root = parent of /tests
4- $repoRoot = Split-Path - Parent $PSScriptRoot
5- $moduleRoot = Join-Path $repoRoot ' module'
3+ # --------------- Path discovery ---------------
64
7- # Manifest lives in /module/OffsetInspect.psd1
8- $script :ManifestPath = Join-Path $moduleRoot ' OffsetInspect.psd1'
5+ # tests folder
6+ $repoRoot = Split-Path - Parent $PSScriptRoot
7+
8+ # Find the first OffsetInspect.psd1 anywhere under the repo
9+ $manifestItem = Get-ChildItem - Path $repoRoot - Filter ' OffsetInspect.psd1' - Recurse - File |
10+ Select-Object - First 1
11+
12+ if (-not $manifestItem ) {
13+ throw " Could not find 'OffsetInspect.psd1' anywhere under '$repoRoot '. " +
14+ " Make sure your module manifest exists and is committed."
15+ }
16+
17+ $script :ManifestPath = $manifestItem.FullName
18+
19+ Write-Host " Using manifest at: $script :ManifestPath "
20+
21+ # --------------- Manifest tests ---------------
922
1023Describe ' OffsetInspect module manifest' {
1124
@@ -20,11 +33,13 @@ Describe 'OffsetInspect module manifest' {
2033
2134 It ' has expected module version' {
2235 $m = Test-ModuleManifest - Path $script :ManifestPath
23- # Keep this in sync with your current release line
36+ # Keep this pattern in sync with your release scheme
2437 $m.Version.ToString () | Should -Match ' ^1\.0\.\d+$'
2538 }
2639}
2740
41+ # --------------- Export tests ---------------
42+
2843Describe ' OffsetInspect module exports' {
2944
3045 BeforeAll {
@@ -44,7 +59,7 @@ Describe 'OffsetInspect module exports' {
4459 It ' exposes FilePaths and OffsetInputs as string[] parameters' {
4560 $cmd = Get-Command Invoke-OffsetInspect - Module $script :ModuleInfo.Name - ErrorAction Stop
4661
47- $cmd.Parameters [' FilePaths' ].ParameterType | Should - Be ([string []])
48- $cmd.Parameters [' OffsetInputs' ].ParameterType | Should - Be ([string []])
62+ $cmd.Parameters [' FilePaths' ].ParameterType | Should - Be ([string []])
63+ $cmd.Parameters [' OffsetInputs' ].ParameterType | Should - Be ([string []])
4964 }
5065}
0 commit comments