useMainSerialExecutor
Serializes all async work to the main thread for the lifetime of the test store.
@MainActor var useMainSerialExecutor: Bool { get set }
Serializes all async work to the main thread for the lifetime of the test store.
@MainActor var useMainSerialExecutor: Bool { get set }
s22ComposableArchitecture9TestStoreC21useMainSerialExecutorSbvp
What are these?52SU1
import ComposableArchitecture
The Composable Architecture (TCA, for short) is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. It can be used in SwiftUI, UIKit, and more, and on any Apple platform (iOS, macOS, tvOS, and watchOS).
@preconcurrency @MainActor final class TestStore<State, Action> where State : Equatable
A testable runtime for a reducer.
@globalActor final actor MainActor
A singleton actor whose executor is equivalent to the main dispatch queue.
@frozen struct Bool
A value type whose instances are either true
or false
.
@MainActor var dependencies: DependencyValues { get set }
The current dependencies of the test store.
@MainActor var exhaustivity: Exhaustivity
The current exhaustivity level of the test store.
@MainActor var timeout: UInt64
The default timeout used in all methods that take an optional timeout.
@MainActor init(initialState: @autoclosure () -> State, reducer: () -> some Reducer<State, Action>, withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in }, fileID: StaticString = #fileID, file filePath: StaticString = #filePath, line: UInt = #line, column: UInt = #column)
Creates a test store with an initial state and a reducer powering its runtime.
@MainActor var isDismissed: Bool { get }
Returns true
if the store’s feature has been dismissed.
@MainActor var state: State { get }
The current state of the test store.
@MainActor func finish(timeout nanoseconds: UInt64? = nil, fileID: StaticString = #fileID, file filePath: StaticString = #filePath, line: UInt = #line, column: UInt = #column) async
Suspends until all in-flight effects have finished, or until it times out.
@MainActor func finish(timeout duration: Duration, fileID: StaticString = #fileID, file filePath: StaticString = #filePath, line: UInt = #line, column: UInt = #column) async
Suspends until all in-flight effects have finished, or until it times out.
@MainActor func withDependencies<R>(_ updateValuesForOperation: (_ dependencies: inout DependencyValues) throws -> Void, operation: () throws -> R) rethrows -> R
Overrides the store’s dependencies for a given operation.
@MainActor func withDependencies<R>(_ updateValuesForOperation: (_ dependencies: inout DependencyValues) throws -> Void, operation: () async throws -> sending R) async rethrows -> R
Overrides the store’s dependencies for a given operation.
@MainActor func withExhaustivity<R>(_ exhaustivity: Exhaustivity, operation: () throws -> R) rethrows -> R
Overrides the store’s exhaustivity for a given operation.
@MainActor func withExhaustivity<R>(_ exhaustivity: Exhaustivity, operation: () async throws -> sending R) async rethrows -> R
Overrides the store’s exhaustivity for a given operation.