Set-ItResult
#
SYNOPSISSet-ItResult is used inside the It block to explicitly set the test result
#
SYNTAX#
Inconclusive#
Pending#
Skipped#
DESCRIPTIONSometimes a test shouldn't be executed, sometimes the condition cannot be evaluated. By default such tests would typically fail and produce a big red message. Using Set-ItResult it is possible to set the result from the inside of the It script block to either inconclusive, pending or skipped.
As of Pester 5, there is no "Inconclusive" or "Pending" test state, so all tests will now go to state skipped, however the test result notes will include information about being inconclusive or testing to keep this command backwards compatible
#
EXAMPLES#
EXAMPLE 1the output should be
#
PARAMETERS#
-InconclusiveDEPRECATED Sets the test result to inconclusive. Cannot be used at the same time as -Pending or -Skipped
#
-PendingDEPRECATED Sets the test result to pending. Cannot be used at the same time as -Inconclusive or -Skipped
#
-SkippedSets the test result to skipped. Cannot be used at the same time as -Inconclusive or -Pending
#
-BecauseSimilarily to failing tests, skipped and inconclusive tests should have reason. It allows to provide information to the user why the test is neither successful nor failed.
#
CommonParametersThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
#
INPUTS#
OUTPUTS#
NOTES#
RELATED LINKShttps://pester.dev/docs/commands/Set-ItResult
#
EDIT THIS PAGEThis page was auto-generated using the comment based help in Pester 5.1.1. To edit the content of this page, change the corresponding help in the pester/Pester repository. See our contribution guide for more information.