diff --git a/src/.ci/test.yml b/src/.ci/test.yml index 0c5daf7..72f8542 100644 --- a/src/.ci/test.yml +++ b/src/.ci/test.yml @@ -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() diff --git a/test/PSDesiredStateConfiguration.Tests.ps1 b/test/PSDesiredStateConfiguration.Tests.ps1 index 608bf93..7404157 100644 --- a/test/PSDesiredStateConfiguration.Tests.ps1 +++ b/test/PSDesiredStateConfiguration.Tests.ps1 @@ -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' + } } }