🩹 [Patch]: Add tests for Organizations #243
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request improves the functionality and testing of GitHub authentication and organization-related commands in the PowerShell module.
Enhancements to GitHub authentication:
src/functions/public/Auth/Connect-GitHubApp.ps1
: Added a new-Default
parameter to set the connected GitHub App as the default context. Updated theSet-GitHubContext
call to include the-Default
parameter. [1] [2] [3]src/functions/public/Auth/Disconnect-GitHubAccount.ps1
: Modified theContext
parameter to accept an array of objects and updated the process block to handle multiple contexts. Added logic to fetch the default context if none is provided. [1] [2]Improvements to test coverage:
tests/GitHub.Tests.ps1
: Added new test contexts for organization-related commands under different authentication scenarios (fine-grained PAT, classic PAT, GitHub App - Enterprise, and GitHub App - Organization). Updated expected context counts in various tests to reflect the new-Default
parameter functionality. [1] [2] [3] [4] [5] [6] [7] [8] [9]Type of change
Checklist