mirror of
https://github.com/PowerShell/PSDesiredStateConfiguration
synced 2026-06-21 13:45:25 +00:00
Add negative get-dscresource test (#16)
This commit is contained in:
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user