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

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Matt Bloomfield Matt Bloomfield 3 months, 3 weeks ago.

  • Author
    Posts
  • #59247
    Profile photo of Greg Tate
    Greg Tate
    Participant

    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
    Profile photo of Matt Bloomfield
    Matt Bloomfield
    Participant

    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.

You must be logged in to reply to this topic.