Skip to content

Commit 16b4ed0

Browse files
committed
Fix test assertions for Pester v4
1 parent e36b812 commit 16b4ed0

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

Tests/Integration/Basic.Integration.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ try {
206206
Context 'Should update the global variable PSRemotely' {
207207

208208
It 'Should clear out Session Hashtable' {
209-
$Global:PSRemotely.SessionHashTable | Should BeNullOrEmpty
209+
$Global:PSRemotely.SessionHashTable.Count | Should Be 0
210210
}
211211
}
212212
}

Tests/Integration/ConfigData.Integration.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Foreach ($RemotelyTestFile in $RemotelyTestFiles) {
5757

5858
It 'Should have a NodeMap for the Nodes created' {
5959
$Global:PSRemotely.NodeMap.count | Should Be 2
60-
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq 'localhost'}) | Should Be $True
61-
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq "$env:ComputerName"}) | Should Be $True
60+
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq 'localhost'}) | Should NOT BeNullOrEmpty
61+
$Global:PSRemotely.NodeMap.Where({$_.NodeName -eq "$env:ComputerName"}) | Should NOT BeNullOrEmpty
6262
}
6363

6464
It 'Should have the PathStatus true for the NodeMap (implies the PSRemotelyNodePath exists)' {
@@ -242,7 +242,7 @@ Foreach ($RemotelyTestFile in $RemotelyTestFiles) {
242242
Context 'Should update the global variable PSRemotely' {
243243

244244
It 'Should clear out Session Hashtable' {
245-
$Global:PSRemotely.SessionHashTable | Should BeNullOrEmpty
245+
$Global:PSRemotely.SessionHashTable.Count | Should Be 0
246246
}
247247
}
248248
}

Tests/Integration/Generic.Integration.Tests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Describe "PSRemotely only accepts *.PSRemotely.ps1 extension files" {
2525

2626
It 'Should throw an error' {
2727
$PSRemotelyError | Should Not BeNullOrEmpty
28-
$PSRemotelyError -like '* is not a *.PSRemotely.ps1 file.' | Should be $True
28+
}
29+
30+
It 'Should throw a custom error message' {
31+
($PSRemotelyError -like '* is not a *.PSRemotely.ps1 file.') | Should NOT BeNullOrEmpty
2932
}
3033
}

Tests/Integration/artifacts/ConfigData.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{
1313
"NodeName" : "localhost",
1414
"ServiceName" : "bits",
15-
"Type" : "Compute"
15+
"Type" : "Storage"
1616
}
1717
]
1818
}

0 commit comments

Comments
 (0)