blockUntilRenderMatches
fun RunScope.blockUntilRenderMatches(terminal: InMemoryTerminal, timeout: Duration? = section.session.defaults.renderTimeout, expected: RenderScope.() -> Unit)(source)
Like blockUntilRenderWhen but using a more readable RenderScope syntax.
For example:
testSession { terminal ->
section { ... }.run {
// do some stuff and then...
blockUntilRenderMatches(terminal) {
red { textLine("expected line 1") }
green { textLine("expected line 2") }
}
}
}Content copied to clipboard
This method will print out a helpful error message if the render doesn't match at the time of the timeout running out.