diff --git a/PSTelegramAPI.bootstrap.ps1 b/PSTelegramAPI.bootstrap.ps1 index 238fd5a..10c4379 100644 --- a/PSTelegramAPI.bootstrap.ps1 +++ b/PSTelegramAPI.bootstrap.ps1 @@ -21,4 +21,14 @@ try { Set-PSRepository PSGallery -InstallationPolicy $Policy } -$RequiredModules | Import-Module \ No newline at end of file +$RequiredModules | Import-Module + +# Install custom version of Pester +& git clone https://github.com/ThePSAdmin/Pester.git Pester; +& cd Pester; +& git pull; +& git checkout fix/jacocoreport; +& cd ..; + +Get-Module Pester | Remove-Module; +Import-Module ./Pester/Pester.psd1 diff --git a/PSTelegramAPI.build.ps1 b/PSTelegramAPI.build.ps1 index 0db3c4e..ffc0a7e 100644 --- a/PSTelegramAPI.build.ps1 +++ b/PSTelegramAPI.build.ps1 @@ -6,7 +6,7 @@ param ($Configuration = 'Development') #region Set-BuildEnvironment -Try { Set-BuildEnvironment -ErrorAction SilentlyContinue -Force } Catch { } +Try { Set-BuildEnvironment -Path '.\PSTelegramAPI' -ErrorAction SilentlyContinue -Force } Catch { } #endregion #region use the most strict mode diff --git a/Tests/PSTelegramAPI.Tests.ps1 b/Tests/PSTelegramAPI.Tests.ps1 index b5241a1..04b5351 100644 --- a/Tests/PSTelegramAPI.Tests.ps1 +++ b/Tests/PSTelegramAPI.Tests.ps1 @@ -1,4 +1,3 @@ -Try { Set-BuildEnvironment -Path "${PSScriptRoot}\.." -ErrorAction SilentlyContinue -Force } Catch { } If (-Not $ENV:TLApiId) { $ENV:TLApiId = [Environment]::GetEnvironmentVariable("TLApiId", "User") } If (-Not $ENV:TLApiHash) { $ENV:TLApiHash = [Environment]::GetEnvironmentVariable("TLApiHash", "User") } @@ -40,7 +39,7 @@ Describe 'Execute Function tests' { It 'New-TLClient: Should fail with invalid ApiHash' { { New-TLClient -ApiId $ENV:TLApiId -ApiHash $Invalid_ApiHash -PhoneNumber $Invalid_PhoneNumber } | Should -Throw "API_ID_INVALID" } - It 'New-TLClient: Should prompt for Code' { + It 'New-TLClient: Should prompt for Code' -Skip { Mock 'Read-Host' { 11111 } -ModuleName PSTelegramAPI { New-TLClient -ApiId $ENV:TLApiId -ApiHash $ENV:TLApiHash -PhoneNumber $Invalid_PhoneNumber } | Should -Throw "The numeric code used to authenticate does not match the numeric code sent by SMS/Telegram" Assert-MockCalled -CommandName Read-Host -ModuleName PSTelegramAPI -Exactly 1