What's the difference between PesterConfiguration Exit, Throw, and the default? #2133
-
I see in New-PesterConfiguration there's a Run.Throw and a Run.Exit, both disabled by default. What does the default setting mean? What do the new settings mean? There's a line of documentation saying that if Exit and Throw are both used then Throw is preferred, but not what the default behavior is, or what either of them affects. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Default is to print report to screen, set If any failed tests/blocks:
|
Beta Was this translation helpful? Give feedback.
Default is to print report to screen, set
$LASTEXITCODE
to number of failed tests (this is always done) and proceed with the script that calledInvoke-Pester
.If any failed tests/blocks:
Run.Throw
will make Pester throw an exception at the end with "x tests failed..." so you can wrapInvoke-Pester
in try/catch.Run.Exit
will exit the process with number of failed tests as exitcode. Typically used to abort a CI-process.