Skip to content

Add unit tests for Invoke-PSClaudeCode#5

Merged
dfinke merged 3 commits intomainfrom
copilot/add-unit-tests-invoke-psclaudecodeagent
Jan 22, 2026
Merged

Add unit tests for Invoke-PSClaudeCode#5
dfinke merged 3 commits intomainfrom
copilot/add-unit-tests-invoke-psclaudecodeagent

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Adds Pester test suite for Invoke-PSClaudeCode, the module's main function.

Test Coverage (27 tests)

  • Parameters: Task, Model, dangerouslySkipPermissions validation
  • Tools: Read-File, Write-File, Run-Command, Delegate-Task schema verification
  • Internal functions: Execute-Tool, Check-Permission, Run-SubAgent behavior
  • API integration: Anthropic endpoint, headers, response processing
  • Module exports: Command availability and ipcc alias

Implementation

Tests validate function structure and configuration via pattern matching on source code, avoiding live API calls. Function content cached in BeforeAll to eliminate duplication across test contexts.

# Run tests
Invoke-Pester -Path ./Tests/Invoke-PSClaudeCode.Tests.ps1

# Result: 27/27 passing
Original prompt

This section details on the original issue you should resolve

<issue_title>Add unit tests</issue_title>
<issue_description>Add unit tests only for Invoke-PSClaudeCodeAgent in PSClaudeCode.psm1</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 21, 2026 20:02
Co-authored-by: dfinke <67258+dfinke@users.noreply.github.com>
Co-authored-by: dfinke <67258+dfinke@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit tests for Invoke-PSClaudeCodeAgent Add unit tests for Invoke-PSClaudeCode Jan 21, 2026
Copilot AI requested a review from dfinke January 21, 2026 20:06
@dfinke dfinke marked this pull request as ready for review January 22, 2026 00:03
@dfinke dfinke merged commit e23803f into main Jan 22, 2026
@dfinke dfinke deleted the copilot/add-unit-tests-invoke-psclaudecodeagent branch January 22, 2026 00:03
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.

Add unit tests

2 participants