View Source SmartCity.TestHelper (smart_city_test v3.0.0)
Common utilities for use in test cases
Link to this section Summary
Functions
Helper function for asynchronous testing
Link to this section Types
Link to this section Functions
@spec eventually(asserting_function(), integer(), integer()) :: :ok | none()
Helper function for asynchronous testing
- Repeats the given block (zero-arity function) until a timeout occurs or it returns a truthy value.
- Catches ExUnit assertions and continues to try the block
- Re-runs block one last time if it times out so assertions are run and throw helpful diffs, etc.