https://kotlinlang.org logo
#orbit-mvi
Title
# orbit-mvi
o

Oleksii Malovanyi

07/02/2021, 10:54 AM
Unfortunately, I have another change request: it’s about
runOnCreate
in tests -> it blocks, so if you have a delay or withTimeout call right when the container is created, your test would still be live timed 😞 https://github.com/orbit-mvi/orbit-mvi/pull/53
👍 1
the only thing to notice, is that it’s required
test()
to be a suspending function –> that’s breaking, but I guess as
testIntent
is suspending too, anyway, it doesn’t matter much ¯\_(ツ)_/¯
m

Mikolaj Leszczynski

07/04/2021, 8:43 PM
Food for thought - I think
runOnCreate
might be a bit hidden inside the
test
function anyway. How about moving it out into its own separate (suspending in suspending test mode, blocking in live test mode) function in
TestContainerHost
instead?
The
onCreate
lambda is not suspending, I suppose the only reason for it to be suspending is so it can run any fired off intents so it’s a bit of a weird one
o

Oleksii Malovanyi

07/05/2021, 11:12 AM
@Mikolaj Leszczynski I like the idea to test
runOnCreate
with it’s own function, so it could look like
Copy code
createViewModel()
            .testOnCreate() // <-- ¯\_(ツ)_/¯ 
            .testIntent { onFilterClick() }
            .assert(initialState) {
                postedSideEffects(OffersEffect.NavigateToFilters)
            }
m

Mikolaj Leszczynski

07/05/2021, 11:16 AM
Makes sense to me, let's make it happen 🙂
Although I think you're missing a
test
At the beginning
o

Oleksii Malovanyi

07/05/2021, 11:17 AM
yeah, sorry, it’s just our internal code style -> we hide test() call under the createViewModel() func
btw,
testOnCreate
or
runOnCreate
🤔
m

Mikolaj Leszczynski

07/05/2021, 11:18 AM
Test I guess
Although not so sure now 😜
o

Oleksii Malovanyi

07/05/2021, 11:19 AM
because, u know, this func would not test anything, just invoke
okay, let me try
@Mikolaj Leszczynski I’ve updated the PR -> it’s ready for review
m

Mikolaj Leszczynski

07/05/2021, 12:52 PM
Cool, thanks. Will take a look when I have some spare time
👌 1
@Oleksii Malovanyi done
o

Oleksii Malovanyi

07/06/2021, 9:04 PM
thanks! I’d better revert changes from the 1st commit first 😞 I’d update PR tmrw – I guess all comments are totally valid 👌
👍 1
@Mikolaj Leszczynski PR is ready for another round of review 😉
m

Mikolaj Leszczynski

07/07/2021, 8:16 PM
@Oleksii Malovanyi 👍 from me, I asked @appmattus to take another look
a

appmattus

07/07/2021, 9:04 PM
Approved and auto merge enabled
o

Oleksii Malovanyi

07/08/2021, 11:44 AM
thanks for the quick feedback 🎉
any possible release date?
m

Mikolaj Leszczynski

07/08/2021, 11:45 AM
Yesterday 😂
4.1.0 but we haven't announced yet
👏 1
o

Oleksii Malovanyi

07/08/2021, 11:47 AM
😲 omg
fyi: I’ve integrated the changes -> seems to be working flawlessly
👍 2
2 Views