Skip to content

Expose pester state inside suite #318

@vors

Description

@vors

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions