Skip to content

[Issue]: Refactor Prepare-Extension.ps1 entry point for testability #262

@WilliamBerryiii

Description

@WilliamBerryiii

Issue Description

scripts/extension/Prepare-Extension.ps1 has a 142-line entry point block that cannot be tested. Similar to Package-Extension.ps1, this script has 100% method coverage but low line coverage due to the untested entry point.

Current state:

  • File coverage: 41% line (102/251)
  • Method coverage: 100% (8/8)
  • Entry point: 0% coverage (142 lines)

Acceptance criteria:

  • Extract entry point logic into Invoke-PrepareExtension function
  • Add tests with mocked file system operations
  • Test directory copy logic, manifest validation, and cleanup
  • Achieve ≥90% line coverage

Estimated coverage improvement: 41% → ~97%

Additional Context

Depends on same patterns as Package-Extension.ps1 refactoring. Can be worked in parallel.

This is part of a broader effort to increase unit test coverage from ~42% to ~85-90%.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttestingTest infrastructure and test files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions