MockkRetryTestRule
class MockkRetryTestRule(maxTries: Int = MAX_RETRIES_COUNT_DEFAULT) : TestRule
Content copied to clipboard
TestRule to work around mockk problem that causes intermittent failures of tests with mocked lambdas.
This rule retries running the failing test until maxTries is reached.
Note: The test class is not recreated between retries. This means that mocks cannot be created in an init
block or as properties of a class. Mutable properties which that can affect tests should also be reset in the before
or test
blocks.