Skip to content

Fix tests that never ran in CI until Discovery stopped failing - #8

Merged
markwragg merged 1 commit into
masterfrom
claude/kind-gates-l25ncw
Nov 18, 2026
Merged

markwragg merged 1 commit into
masterfrom
claude/kind-gates-l25ncw

Conversation

@markwragg

Copy link
Copy Markdown
Owner

Follow-up to #7. Before #7, every test file under Tests/Private and Tests/Public failed Pester Discovery on all platforms, so their tests never ran. Now that they run, three fail in the master build:

  • Should match files by their full path (Skip-ExcludedItem.Tests.ps1, Watch-Command.Tests.ps1), Linux and macOS: the pattern was built as "$Folder\*.log". A backslash isn't a path separator there, so it never matched. Both tests now use Join-Path $Folder '*.log'.
  • Should throw the same error when a host pipes input to it directly (Watch-Command.Tests.ps1), all platforms: (Get-Module Watch).Path returned $null from inside InModuleScope once the globally imported staged module was removed before importing the source. The test now uses the module's own path ($ExecutionContext.SessionState.Module.Path).

Windows PowerShell 5.1 coverage was already back to 99.71% in the #7 run.

Testing

Ran CI's build flow (CombineFunctionsAndStage then Test) on Linux with PowerShell 7.4: the three tests above now pass. Two other tests (the -AsString exclusion and the table-view render) fail only in that headless container. They passed on all three CI runners, so they are not changed here. This PR's CI run is the check on Windows, Windows PowerShell 5.1 and macOS.


Generated by Claude Code

These tests were hidden by the Discovery failures fixed in the previous commit,
and fail now that they run:

- Build the -Exclude test paths with Join-Path instead of "$Folder\*.log". On
  Linux and macOS the backslash isn't a path separator, so the pattern never
  matched the files.
- Get the module path from the module itself when importing it into a new
  runspace. Get-Module Watch returns nothing from inside InModuleScope now that
  the staged copy (imported globally) is removed before the source is imported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MFNjHmNmZhLMjcqfcoYzw6
@markwragg
markwragg merged commit 0c039bc into master Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants