Pester custom error text


Pester custom error text



Does anyone know if Pester supports custom error texts?



Lets say I've the following test:


Describe "Get-HelloWorld" {
It "outputs 'Hello world!'" {
Get-HelloWorld | Should Be 'Hello world!'
}
}



Is there a way that I can set some custom error message if Get-HelloWorld returns another string than "Hello World"?


Get-HelloWorld



Thx




1 Answer
1



The latest version of Pester supports -Because where you can add some custom text that explains the purpose of the test.


-Because






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

How to make file upload 'Required' in Contact Form 7?

Rothschild family

amazon EC2 - How to make wp-config.php to writable?