Defines a series of steps to perform at the end of the current container, Context or Describe block.
AfterAll is used to share teardown after all the tests in a container, Describe or Context including all child blocks and tests. AfterAll runs during Run phase and runs only once in the current block. It's guaranteed to run even if tests fail.
The typical usage is to clean up state or temporary used in tests.
BeforeAll and AfterAll are unique in that they apply to the entire container, Context or Describe block regardless of the order of the statements compared to other Context or Describe blcoks at the same level.
This example uses AfterAll to clean up a sample-file generated only for the tests in the Describe-block.
A scriptblock with steps to be executed during teardown.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This 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.