microsoft / PowerShellForGitHub

Microsoft PowerShell wrapper for GitHub API
Other
588 stars 186 forks source link

GitHubRepositories: Unit Tests are Failing when Checking for `has_wiki` on Private Repositories #403

Closed X-Guardian closed 1 year ago

X-Guardian commented 1 year ago

Issue Details

The Tests/GithubRepositories.test.ps1 New-GitHubRepository unit tests are failing when creating private repositories and checking that the has_wiki property is true.

This is due to support for Wikis being removed from private repos in the GitHub free tier.

image

Steps to reproduce the issue

invoke-pester Tests\GitHubRepositories.tests.ps1

Verbose logs showing the problem

[-] GitHubRepositories\New-GitHubRepository.When creating a repository for the authenticated user.When creating a private repository with default settings.Should return the correct properties 34ms (33ms|1ms)
 Expected $true, but got $false.
 at $repo.has_Wiki | Should -BeTrue, Tests\GitHubRepositories.tests.ps1:91
 at <ScriptBlock>, Tests\GitHubRepositories.tests.ps1:91
[-] GitHubRepositories\New-GitHubRepository.When creating an organization repository.When creating a private repository with default settings.Should return the correct properties 19ms (18ms|1ms)
 Expected $true, but got $false.
 at $repo.has_Wiki | Should -BeTrue, Tests\GitHubRepositories.tests.ps1:286
 at <ScriptBlock>, Tests\GitHubRepositories.tests.ps1:286

Suggested solution to the issue

Remove the has_wiki check from the New-GitHubRepository unit tests.

Requested Assignment

Operating System

OSVersion                      Microsoft Windows NT 10.0.19045.0
Is 64-bit                      True
Current culture                en-GB
Current UI culture             en-GB

PowerShell Version

PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module Version

Running: 0.16.1 0.16.1
Installed: 0.16.1