assertOnlyInstance property

T assertOnlyInstance

A component instance to use for read-only operations (expect, assert) ONLY.

Warning this instance is not stabilized and so the test will not be in a stable state likely leading to unexpected results. State changes to the instance should be done through the update call, or external stabilized mechanism such as page objects. Use this ONLY for simple expects of the instance state.

#Example

await fixture.update((c) {
  c.value = 5;
});
expect(fixture.assertOnlyInstance.square, 25, reason:
    'Instance should square the number');

Implementation

T get assertOnlyInstance => _rootComponentRef.instance;