Type Aliases

The following type aliases are available globally.

Example Hooks

  • An async closure executed before an example is run.

    Declaration

    Swift

    public typealias BeforeExampleAsyncClosure = () async -> Void
  • A closure executed before an example is run. Synchronous version for Objc support.

    Declaration

    Swift

    public typealias BeforeExampleClosure = () -> Void
  • An async 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 -> 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. Synchronus version for Objc support.

    Declaration

    Swift

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

    Declaration

    Swift

    public typealias AfterExampleAsyncClosure = BeforeExampleAsyncClosure
  • A closure executed after an example is run. Synchronous version for Objc support.

    Declaration

    Swift

    public typealias AfterExampleClosure = BeforeExampleClosure
  • An 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 closure executed after an example is run. The closure is given example metadata, which contains information about the example that has just finished running. Synchronous version for Objc support.

    Declaration

    Swift

    public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure
  • A closure which wraps an example. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleClosure = (_ runExample: @escaping () -> Void) -> Void
  • A 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) -> Void
  • An async closure which wraps an example. The closure must call runExample() exactly once.

    Declaration

    Swift

    public typealias AroundExampleAsyncClosure = (_ runExample: @escaping () async -> Void) async -> Void
  • An async 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 -> Void

Suite Hooks

  • An closure executed before any examples are run.

    Declaration

    Swift

    public typealias BeforeSuiteAsyncClosure = () async -> Void
  • A closure executed before any examples are run. Synchronous version for Objc support.

    Declaration

    Swift

    public typealias BeforeSuiteClosure = () -> Void
  • A closure executed after all examples have finished running.

    Declaration

    Swift

    public typealias AfterSuiteAsyncClosure = BeforeSuiteAsyncClosure
  • A closure executed after all examples have finished running. Synchronous version for Objc support.

    Declaration

    Swift

    public typealias AfterSuiteClosure = BeforeSuiteClosure
  • 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