Pester - Specifying Context{} or It{} blocks during testing

Welcome Forums General PowerShell Q&A Pester - Specifying Context{} or It{} blocks during testing

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 3 months ago.

  • Author
  • #59247

    Points: 1
    Rank: Member

    Is there a way to specify particular Context or It blocks when using the Invoke-Pester command?

    As I write tests, I'd like a convenient way to call specific Context or It block rather than having the Invoke-Pester command run through all tests within a Describe block.

    Current method is to comment out the code.

    I see there's a -Tag parameter, but it appears to be only applicable to the Describe block.

  • #59439

    Points: 41
    Rank: Member

    Just been reading through the wiki and issues log for Pester and there are similar requests for this functionality so it's doesn't look like it's possible at the moment.

    However, rather than comment out tests, you could just add the -Skip parameter to the It block so that the test doesn't run.

The topic ‘Pester - Specifying Context{} or It{} blocks during testing’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort