<div class='type'>Function</div>


<a id='references'></a>


<h2 id="assert-matcher-messageprefixonerror">assert</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun SemanticsNodeInteraction.assert(
    matcher: SemanticsMatcher,
    messagePrefixOnError: (() -> String)? = null,
): SemanticsNodeInteraction
```


Asserts that the provided `matcher` is satisfied for this node.

#### Parameters

| | |
| --- | --- |
| matcher | Matcher to verify. |
| messagePrefixOnError | Prefix to be put in front of an error that gets thrown in case this assert fails. This can be helpful in situations where this assert fails as part of a bigger operation that used this assert as a precondition check. |