-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
enhancementNew feature or requestNew feature or requesttestingTest infrastructure and test filesTest infrastructure and test files
Description
Issue Description
scripts/extension/Package-Extension.ps1 has a 129-line <script> entry point block that cannot be tested via dot-sourcing. This code handles path validation, version resolution, directory operations, vsce invocation, and cleanup.
Current state:
- File coverage: 27% line (55/204)
- Method coverage: 100% (7/7) — all pure functions are tested
- Entry point: 0% coverage (129 lines)
Acceptance criteria:
- Extract entry point logic into
Invoke-PackageExtensionfunction - Keep
<script>block as thin wrapper calling the new function - Add comprehensive tests with mocked file system and vsce calls
- Test parameter validation, error paths, and cleanup logic
- Achieve ≥85% line coverage
Estimated coverage improvement: 27% → ~90%
Additional Context
This follows the refactoring pattern established in PR #221 ("extract pure functions for Pester testability"). The entry point contains business logic that should be testable:
- Version resolution from manifest
- Extension directory validation
- vsce command construction
- Output path handling
This is part of a broader effort to increase unit test coverage from ~42% to ~85-90%.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesttestingTest infrastructure and test filesTest infrastructure and test files