Context

Anees Ahee edited this page Apr 12, 2017 · 3 revisions

Provides logical grouping of It blocks within a single Describe block. Any Mocks defined inside a Context are removed at the end of the Context scope, as are any files or folders added to the 'TestDrive:' path during the Context block's execution. Any BeforeEach or AfterEach blocks defined inside a Context also only apply to tests within that Context.

PARAMETERS

Name

The name of the Context. This is a phrase describing a set of tests within a describe.

Fixture

Script that is executed. This may include setup specific to the context and one or more It blocks that validate the expected outcomes.

EXAMPLE

Describe "Description Name" {
    Context "Context Name #1" {
         It "..." { ... }
    }

    Context "Context Name #2" {
        It "..." { ... }
        It "..." { ... }
        It "..." { ... }
    }
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.