Skip to content

Testing

Omega pushes business rules into OmegaFlow and OmegaAgent classes that depend on an OmegaChannel and OmegaFlowManager — you can flutter test them with plain Dart (no WidgetTester) for most scenarios.


What to test first

TargetIdea
Agent + behaviorEmit events on a test channel; assert reactions / follow-up events / onAction branches.
FlowPut flow in running, call receiveIntent / drive onEvent, assert expressions or emitted events.
FlowManagerregisterFlow, switchTo, handleIntent / handleTypedIntent, then read getAppSnapshot() or expression streams.
NavigatorIntegration-style tests can still pump MaterialApp with navigatorKey from bootstrap — keep these fewer in number.

Idle / paused flows ignore intents until activated — assert both paths.


Package tests as reference

The omega_architecture repository test/ folder contains unit tests for flows, agents, expressions, and manager behaviour. Clone or browse on GitHub and copy patterns into your app’s test/ tree.


Contracts in tests

When you use OmegaFlowContract / OmegaAgentContract, debug warnings only appear in debug mode — tests run with assertions you write explicitly; contracts remain useful as documentation of expected traffic.