Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement request: Support nested context with associated it blocks #37

Open
ChrisLynchHPE opened this issue Jun 29, 2017 · 1 comment

Comments

@ChrisLynchHPE
Copy link

I have tested the following script to test nested Pester Context blocks:

#pester nested context test with 4.0.3

describe "Nested Context Test with Pester 4.0.3" {

    context "Context #1" {

        it "will test foo" {

            'foo' | should be foo

        }

        context "nested contex 1" {

            it "will test foo again" {

                'foo' | should not be foo

            }

        }

    }
    
}

And pester fully supports it:

Executing all tests in .\pester-test.ps1

Executing script .\pester-test.ps1

  Describing Nested Context Test with Pester 4.0.3

    Context Context #1
      [+] will test foo 517ms

      Context nested contex 1
        [-] will test foo again 182ms
          Expected: value was {foo}, but should not have been the same
          at <ScriptBlock>, C:\temp\pester\pester-test.ps1: line 18
          18:                 'foo' | should not be foo
Tests completed in 699ms
Tests Passed: 1, Failed: 1, Skipped: 0, Pending: 0, Inconclusive: 0

However, Format-Pester results does not handle the nested context blocks in the report generated. Can you please add support for this pester feature?

@it-praktyk
Copy link
Collaborator

We will consider it. Pull requests are welcomed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants