Skip to content

Commit

Permalink
Add temp tests for troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlydog committed Apr 20, 2024
1 parent 31abbe5 commit 3d0a37b
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/tiPS/Public/Get-PowerShellTip.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ InModuleScope -ModuleName tiPS { # Must use InModuleScope to access script-level

$tip | Should -Not -BeNullOrEmpty
$script:UnshownTips.Count | Should -Be ($TotalNumberOfTips - 1)
}






It 'temp troubleshooting 1' {
# Temp code for troubleshooting tests on Windows PowerShell.
[string] $powerShellTipsJsonFilePath = Resolve-Path "$PSScriptRoot\..\PowerShellTips.json"
$content = Get-Content -Path $powerShellTipsJsonFilePath
Expand All @@ -193,6 +193,31 @@ InModuleScope -ModuleName tiPS { # Must use InModuleScope to access script-level
$content | Should -Be "not actually this"
$numberOfTipsInJsonFile | Should -Be 48
}

It 'temp troubleshooting 2' {
# Temp code for troubleshooting tests on Windows PowerShell.
[string] $powerShellTipsJsonFilePath = Resolve-Path "$PSScriptRoot\..\PowerShellTips.json"
$content = Get-Content -Path $powerShellTipsJsonFilePath
[int] $numberOfTipsInJsonFile =
$content |
ConvertFrom-Json |
Measure-Object |
Select-Object -ExpandProperty Count
$content | Should -Be "not actually this"
$numberOfTipsInJsonFile | Should -Be 48
}

It 'temp troubleshooting 3' {
# Temp code for troubleshooting tests on Windows PowerShell.
[string] $powerShellTipsJsonFilePath = Resolve-Path "$PSScriptRoot\..\PowerShellTips.json"
$content = Get-Content -Path $powerShellTipsJsonFilePath
[int] $numberOfTipsInJsonFile =
$content |
ConvertFrom-Json |
Measure-Object |
Select-Object -ExpandProperty Count
$numberOfTipsInJsonFile | Should -Be 48
}
}

Context 'When only one tip is still left to be shown' {
Expand Down

0 comments on commit 3d0a37b

Please sign in to comment.