Scenario: I have a clean-up logic in my test suite. I don't want to run it, if one of the tests failed or throw. I want to preserve everything as is for future investigations.
How I can achieve it?
I can pull cleanup logic to a separate file that calls Invoke-Pester -PassThru and exam result object. But my cleanup exists in the form of test (I tests cleanup logic itself in the cleanup). I would like to have an ability to get some knowledge about fails directly in tests, so I can make a decision, run cleanup tests or not in the same suite.
Suggested solution: provide API (function) to get an immutable copy of current PesterState
Scenario: I have a clean-up logic in my test suite. I don't want to run it, if one of the tests failed or throw. I want to preserve everything as is for future investigations.
How I can achieve it?
I can pull cleanup logic to a separate file that calls
Invoke-Pester -PassThruand exam result object. But my cleanup exists in the form of test (I tests cleanup logic itself in the cleanup). I would like to have an ability to get some knowledge about fails directly in tests, so I can make a decision, run cleanup tests or not in the same suite.Suggested solution: provide API (function) to get an immutable copy of current PesterState