PluginTestScope

A class which provides DSL for testing a StorePlugin.

Contains:

  • ctx or this - a mock pipeline context configured specifically for testing.

  • TestPipelineContext.plugin - the plugin being tested

  • timeTravel embedded time travel plugin to track any side effects that the plugin produces.

See StorePlugin.test for a function that allows to test the plugin

Constructors

Link copied to clipboard
constructor(configuration: StoreConfiguration<S>, plugin: LazyPlugin<S, I, A>, timeTravel: TimeTravel<S, I, A>)

Properties

Link copied to clipboard
open override val config: StoreConfiguration<S>
Link copied to clipboard
Link copied to clipboard
open override val key: CoroutineContext.Key<*>
Link copied to clipboard
open override val name: String?
Link copied to clipboard
open override val state: S
Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun action(action: A)
Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun <T> Flow<T>.consume(context: CoroutineContext)
Link copied to clipboard
open suspend override fun emit(intent: I)
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun intent(intent: I)
Link copied to clipboard
open operator override fun invoke(config: StoreConfiguration<S>): StorePlugin<S, I, A>
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onAction(action: A): A?
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onException(e: Exception): Exception?
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onIntent(intent: I): I?
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onStart()
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onState(old: S, new: S): S?
Link copied to clipboard
open override fun onStop(e: Exception?)
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onSubscribe(newSubscriberCount: Int)
Link copied to clipboard
open suspend override fun PipelineContext<S, I, A>.onUnsubscribe(newSubscriberCount: Int)
Link copied to clipboard
open operator override fun plus(context: CoroutineContext): CoroutineContext
Link copied to clipboard
open override fun send(action: A)
Link copied to clipboard
inline suspend fun <S : MVIState, I : MVIIntent, A : MVIAction> LazyPlugin<S, I, A>.test(initial: S, timeTravel: TimeTravel<S, I, A> = TimeTravel(), crossinline configuration: StoreConfigurationBuilder.() -> Unit = { debuggable = true }, crossinline block: suspend PluginTestScope<S, I, A>.() -> Unit)

A function that runs a test on a StorePlugin.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open suspend override fun updateState(transform: suspend S.() -> S)
Link copied to clipboard
open override fun updateStateImmediate(block: S.() -> S)
Link copied to clipboard
open override fun useState(block: S.() -> S)
Link copied to clipboard
open suspend override fun withState(block: suspend S.() -> Unit)