Skip to content

Commit 61e5c18

Browse files
committed
Update integration tests to assert specific error messages for missing KeyProperty
1 parent 8fc3e4e commit 61e5c18

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/Integration/Resources/DSCv3_DebugDscEngine.Integration.Tests.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,12 @@ Describe "$($script:dscResourceFriendlyName)_Integration" -Tag @('Integration_SQ
235235
$dscExitCode = $LASTEXITCODE # cSpell: ignore LASTEXITCODE
236236

237237
Write-Verbose -Message "DSCv3 exit code: $($dscExitCode | Out-String)" -Verbose
238-
Write-Verbose -Message "Result (all):`n$($result | ConvertTo-Json | Out-String)" -Verbose
239238

240239
if ($dscExitCode -ne 0)
241240
{
242241
throw ('DSC executable failed with exit code {0}.' -f $dscExitCode)
243242
}
244-
} | Should -Throw
243+
} | Should -Throw -ExpectedMessage 'MOCK ERROR: KeyProperty is required'
245244
}
246245

247246
It 'Should fail when MandatoryProperty is empty' {
@@ -256,7 +255,6 @@ Describe "$($script:dscResourceFriendlyName)_Integration" -Tag @('Integration_SQ
256255
$dscExitCode = $LASTEXITCODE # cSpell: ignore LASTEXITCODE
257256

258257
Write-Verbose -Message "DSCv3 exit code: $($dscExitCode | Out-String)" -Verbose
259-
Write-Verbose -Message "Result (all):`n$($result | ConvertTo-Json | Out-String)" -Verbose
260258

261259
if ($dscExitCode -ne 0)
262260
{

0 commit comments

Comments
 (0)