Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"?

Thx

like image 650
Moerwald Avatar asked Oct 23 '25 09:10

Moerwald


1 Answers

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

like image 62
Mark Wragg Avatar answered Oct 26 '25 07:10

Mark Wragg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!