Type Aliases

The following type aliases are available globally.

Example Hooks

  • An async throwing closure executed before an example is run.

    Declaration

    Swift

    public typealias BeforeExampleAsyncClosure = () async throws -> Void
  • A throwing closure executed before an example is run.

    Declaration

    Swift

    public typealias BeforeExampleClosure = () throws -> Void
  • A closure executed before an example is run. This is only used by ObjC.

    Declaration

    Swift

    public typealias BeforeExampleNonThrowingClosure = () -> Void
  • An async throwing closure executed before an example is run. The closure is given example metadata, which contains information about the example that is about to be run.

    Declaration

    Swift

    public typealias BeforeExampleWithMetadataAsyncClosure = (_ exampleMetadata: ExampleMetadata) async throws -> Void
  • A throwing closure executed before an example is run. The closure is given example metadata, which contains information about the example that is about to be run.

    Declaration

    Swift

    public typealias BeforeExampleWithMetadataClosure = (_ exampleMetadata: ExampleMetadata) throws -> Void
  • A closure executed before an example is run. The closure is given example metadata, which contains information about the example that is about to be run. This is only used by ObjC

    Declaration

    Swift

    public typealias BeforeExampleWithMetadataNonThrowingClosure = (_ exampleMetadata: ExampleMetadata) -> Void
  • An async throwing closure executed after an example is run.

    Declaration

    Swift

    public typealias AfterExampleAsyncClosure = BeforeExampleAsyncClosure
  • A throwing closure executed after an example is run.

    Declaration

    Swift

    public typealias AfterExampleClosure = BeforeExampleClosure
  • A closure executed after an example is run. This is only used by ObjC

    Declaration

    Swift

    public typealias AfterExampleNonThrowingClosure = BeforeExampleNonThrowingClosure
  • An async throwing closure executed after an example is run. The closure is given example metadata, which contains information about the example that has just finished running.

    Declaration

    Swift

    public typealias AfterExampleWithMetadataAsyncClosure = BeforeExampleWithMetadataAsyncClosure
  • A throwing closure executed after an example is run. The closure is given example metadata, which contains information about the example that has just finished running.

    Declaration

    Swift

    public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure
  • A closure executed after an example is run. The closure is given example metadata, which contains information about the example that has just finished running.

    Declaration

    Swift

    public typealias AfterExampleWithMetadataNonThrowingClosure = BeforeExampleWithMetadataNonThrowingClosure
  • A throwing closure which wraps an example. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleClosure = (_ runExample: @escaping () -> Void) throws -> Void
  • A closure which wraps an example. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleNonThrowingClosure = (_ runExample: @escaping () -> Void) -> Void
  • A throwing closure which wraps an example. The closure is given example metadata, which contains information about the example that the wrapper will run. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleWithMetadataClosure =
        (_ exampleMetadata: ExampleMetadata, _ runExample: @escaping () -> Void) throws -> Void
  • A throwing closure which wraps an example. The closure is given example metadata, which contains information about the example that the wrapper will run. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleWithMetadataNonThrowingClosure =
        (_ exampleMetadata: ExampleMetadata, _ runExample: @escaping () -> Void) -> Void
  • An async throwing closure which wraps an example. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleAsyncClosure = (_ runExample: @escaping () async -> Void) async throws -> Void
  • An async throwing closure which wraps an example. The closure is given example metadata, which contains information about the example that the wrapper will run. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleWithMetadataAsyncClosure =
        (_ exampleMetadata: ExampleMetadata, _ runExample: @escaping () async -> Void) async throws -> Void

Suite Hooks

  • An async throwing closure executed before any examples are run.

    Declaration

    Swift

    public typealias BeforeSuiteAsyncClosure = () async throws -> Void
  • A throwing closure executed before any examples are run.

    Declaration

    Swift

    public typealias BeforeSuiteClosure = () throws -> Void
  • A closure executed before any examples are run.

    Declaration

    Swift

    public typealias BeforeSuiteNonThrowingClosure = () -> Void
  • An async throwing closure executed after all examples have finished running.

    Declaration

    Swift

    public typealias AfterSuiteAsyncClosure = BeforeSuiteAsyncClosure
  • A throwing closure executed after all examples have finished running.

    Declaration

    Swift

    public typealias AfterSuiteClosure = BeforeSuiteClosure
  • A closure executed after all examples have finished running.

    Declaration

    Swift

    public typealias AfterSuiteNonThrowingClosure = BeforeSuiteNonThrowingClosure
  • A closure that, when evaluated, returns a dictionary of key-value pairs that can be accessed from within a group of shared examples.

    Declaration

    Swift

    public typealias SharedExampleContext = () -> [String : Any]
  • A closure that is used to define a group of shared examples. This closure may contain any number of example and example groups.

    Declaration

    Swift

    public typealias SharedExampleClosure = (@escaping SharedExampleContext) -> Void