Add negative get-dscresource test (#16)

This commit is contained in:
Travis Plunk
2019-08-09 12:10:49 -07:00
committed by GitHub
parent 96d155a4ed
commit eb31aa91c1
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -89,12 +89,16 @@ jobs:
- ${{ parameters.powershellExecutable }}: |
Invoke-PSPackageProjectTest -Type Functional
displayName: Execute functional tests
errorActionPreference: continue
- ${{ parameters.powershellExecutable }}: |
Invoke-PSPackageProjectTest -Type StaticAnalysis
displayName: Execute static analysis tests
errorActionPreference: continue
condition: succeededOrFailed()
- ${{ parameters.powershellExecutable }}: |
Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore
displayName: Unregister temporary PSRepository
condition: always()
@@ -67,5 +67,12 @@ Describe "Test PSDesiredStateConfiguration" -tags CI {
$resource = Get-DscResource -Name $Name -Module $ModuleName
$resource | Should -Not -BeNullOrEmpty
}
# Fails on on platforms
it "should throw when resource is not found" -Pending {
{
Get-DscResource -Name antoehusatnoheusntahoesnuthao -Module tanshoeusnthaosnetuhasntoheusnathoseun
} |
Should -Throw -ErrorId 'Microsoft.PowerShell.Commands.WriteErrorException,CheckResourceFound'
}
}
}