Skip to content

Commit 863cb81

Browse files
🩹 [Patch]: Add tests for Get-GitHubUser and Set-GitHubUser (#237)
## Description - Add tests for `Get-GitHubUser` and `Set-GitHubUser` ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 33908ef commit 863cb81

File tree

5 files changed

+309
-208
lines changed

5 files changed

+309
-208
lines changed

src/functions/public/Users/Get-GitHubUserCard.ps1 renamed to src/functions/private/Users/Get-GitHubUserCard.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
```
1818
1919
.EXAMPLE
20+
Get-GitHubUserCard -Username 'octocat' -SubjectType 'repository' -SubjectID 1300192
2021
2122
.NOTES
2223
[Get contextual information for a user](https://docs.github.com/rest/users/users#get-contextual-information-for-a-user)
2324
#>
24-
#SkipTest:FunctionTest:Will add a test for this function in a future PR
2525
[OutputType([pscustomobject])]
2626
[CmdletBinding()]
2727
param(

src/functions/public/Auth/Connect-GitHubApp.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
.NOTES
3535
[Authenticating to the REST API](https://docs.github.com/rest/overview/other-authentication-methods#authenticating-for-saml-sso)
3636
#>
37+
#SkipTest:FunctionTest:Will add a test for this function in a future PR
3738
[OutputType([void])]
3839
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Justification = 'Is the CLI part of the module.')]
3940
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '',

src/functions/public/Users/Get-GitHubUser.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
.NOTES
2727
[Get the authenticated user](https://docs.github.com/rest/users/users)
2828
#>
29-
#SkipTest:FunctionTest:Will add a test for this function in a future PR
3029
[OutputType([pscustomobject])]
3130
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
3231
'PSReviewUnusedParameter',
3332
'All',
3433
Justification = 'Parameter is used in dynamic parameter validation.'
3534
)]
36-
[CmdletBinding(DefaultParameterSetName = '__DefaultSet')]
35+
[CmdletBinding(DefaultParameterSetName = '__AllParameterSets')]
3736
param(
3837
# The handle for the GitHub user account.
3938
[Parameter(
@@ -75,7 +74,7 @@
7574
process {
7675
try {
7776
switch ($PSCmdlet.ParameterSetName) {
78-
'__DefaultSet' {
77+
'__AllParameterSets' {
7978
$user = Get-GitHubMyUser -Context $Context
8079
$social_accounts = Get-GitHubMyUserSocials -Context $Context
8180
$user | Add-Member -MemberType NoteProperty -Name 'social_accounts' -Value $social_accounts -Force

src/functions/public/Users/Set-GitHubUser.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
.NOTES
2727
[Update the authenticated user](https://docs.github.com/rest/users/users#update-the-authenticated-user)
2828
#>
29-
#SkipTest:FunctionTest:Will add a test for this function in a future PR
3029
[OutputType([void])]
3130
[Alias('Update-GitHubUser')]
3231
[CmdletBinding(SupportsShouldProcess)]
@@ -88,6 +87,7 @@
8887
hireable = $Hireable
8988
bio = $Bio
9089
}
90+
$body | Remove-HashtableEntry -NullOrEmptyValues
9191

9292
$inputObject = @{
9393
Context = $Context

0 commit comments

Comments
 (0)