expectRemember

abstract fun expectRemember(description: String, exactMatch: Boolean = true, matcher: (RenderTester.RememberInvocation) -> Boolean): RenderTester<PropsT, StateT, OutputT, RenderingT>(source)

Specifies that this render pass is expected to remember a calculated value with parameters that satisfy matcher. This expectation is strict, and will fail if multiple side effects match.

Parameters

description

String that will be used to describe this expectation in error messages. The description is required since no human-readable description can be derived from the predicate alone.

exactMatch

If true, then the test will fail if any other matching expectations are also exact matches, and the expectation will only be allowed to match a single side effect. If false, the match will only be used if no other expectations return exclusive matches (in which case the first match will be used), and the expectation may match multiple side effects.

matcher

A function that is passed the parameters from RenderContext.remember and return true if such a call expected.