Comments (2)
Also, shouldn't the following test pass, because runBlockingTest
throws an exception, i.e. the BadOrWrongStateException
?
class FailsWithBadOrWrongStateExceptionTest {
companion object {
private val testCoroutineDispatcher = TestCoroutineDispatcher()
}
@get:Rule
val uniflowTestDispatchersRule = UniflowTestDispatchersRule(testCoroutineDispatcher)
@Test
fun `actionOn wrong state fails with BadOrWrongStateException`() {
assertFailsWith<BadOrWrongStateException> {
testCoroutineDispatcher.runBlockingTest {
object : AndroidDataFlow(defaultState = UIState.Empty) {
init {
actionOn<UIState.Loading> {}
}
}
}
}
}
}
Instead, the exception isn't thrown by runBlockingTest
and therefore the assertion fails.
from uniflow-kt.
On your first test, we can see that the error is thrown twice on the dataFlow onError
function:
With the following stack if we add debug logs message:
Fix would consist in catch the BadOrWrongStateException
to log it, but not throw it
I push the PR 👍
from uniflow-kt.
Related Issues (20)
- Android & AndroidX package merge HOT 3
- Avoid re-send unchanged states HOT 4
- Issue updating state HOT 2
- Allow MockedViewObserver to return state object to improve testing HOT 2
- Using flow from database HOT 1
- JCenter migration HOT 6
- Can we promote the beta version to stable? HOT 12
- Possibility to observe own state (or state changes) HOT 1
- What's next with StateFlowPublisher? HOT 1
- Receive events in jetpack compose? HOT 3
- Testing improvment - verifySequence HOT 1
- Question related to actionOn<> HOT 7
- Bug consuming events in two places HOT 1
- Using sealed classes for intents. HOT 2
- LiveDataPublisher - publishState always publish state HOT 1
- Default state isn't emitted in tests HOT 7
- Uniflow 1.1.0 released 🎉
- Restore state doesn't update state in base class HOT 2
- Could not find uniflow-android-1.1.1.aar HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uniflow-kt.