Skip to content

Add unit tests for Write-PSNowStructuredLog and Get-PSNowEnvironmentVariables helpers #52

@johnmccrae

Description

@johnmccrae

Problem

tests/Unit has coverage for the four main functions but no direct tests for Write-PSNowStructuredLog or the private environment helpers (GetPSNowOs, Get-PSNowTempDirectory). Bugs in these shared utilities would only surface indirectly through higher-level test failures.

Files

  • Private/Write-PSNowStructuredLog.ps1
  • Private/Get-PSNowEnvironmentVariables.ps1

Acceptance Criteria

  • tests/Unit/Write-PSNowStructuredLog.tests.ps1 created with tests for: correct output format, multi-field entries, empty fields dict
  • tests/Unit/Get-PSNowEnvironmentVariables.tests.ps1 created with tests for: Windows/macOS/Linux OS detection (mocked), temp path resolution, unsupported-OS error
  • All new tests pass on both Windows and Linux CI runners
  • Test count increases by at least 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions