-
-
Notifications
You must be signed in to change notification settings - Fork 478
Closed
Description
I reviewed the Should Wiki Page, and i apologize if i missed how to use this, but i was working with some error handling, and i want to Pester for non terminating errors as well as Exceptions. Basically, i have some tests in a function that are in the Process block, and i still want the End block to process, so in this case i want to use Write-Error rather then Throw, so, in my pester assertion, i want to make sure the Catch block is being hit, and the Write-Error is being executed, and im not sure how to do that.
It 'Error should be raised' {
My-FunctionThatWritesErrorForInvalidPath -Path '.\InvalidPath' | Should #Here is where im lost, maybe Should Error would be nice.
}I hope that makes sense and im sorry if im just using Write-Error incorrectly, and i could use the 'Should Throw' assertion.
thanks for any help.
deadlydog
Metadata
Metadata
Assignees
Labels
No labels