TestState

@propertyWrapper
public struct TestState<T>

A property wrapper that will automatically reset the contained value after each test.

  • Undocumented

    Declaration

    Swift

    public var wrappedValue: T! { get set }
  • Resets the property to nil after each test.

    Declaration

    Swift

    public init()
  • Undocumented

    Declaration

    Swift

    public init(wrappedValue: @autoclosure @escaping () -> T?)
  • Sets the property to an initial value before each test and resets it to nil after each test.

    Declaration

    Swift

    public init(_ initialValue: @autoclosure @escaping () -> T)

    Parameters

    initialValue

    An autoclosure to return the initial value to use before the test.