John O'Reilly
12/29/2021, 1:56 PMcommonTest in KMM module using new runTest provided in Kotlinx Coroutines 1.6 to test some code that uses apollo...it runs fine for android, jvm but get issue when running for iOS .🧵John O'Reilly
12/29/2021, 1:57 PMJohn O'Reilly
12/29/2021, 1:57 PMJohn O'Reilly
12/29/2021, 1:58 PMval people = repo.people.first()
assertTrue(people.isNotEmpty())
println(people)
testing the following flow that's in repository class
val people = apolloClient.query(GetAllPeopleQuery()).watch().map {
it.dataAssertNoErrors.allPeople.people.mapNotNull { it?.personFragment?.mapToModel() }
}John O'Reilly
12/29/2021, 1:59 PMfirst() above never returning
UncompletedCoroutinesError: After waiting for 60000 ms, the test coroutine is not completing, there were active child jobsJohn O'Reilly
12/29/2021, 2:01 PMJohn O'Reilly
12/29/2021, 2:05 PMpeople flow above with some dummy flow { emit() } for example it works finembonnin
12/29/2021, 10:21 PMmbonnin
12/29/2021, 10:22 PMrunTest method that does this in apollo-testing-supportmbonnin
12/29/2021, 10:23 PMJohn O'Reilly
12/30/2021, 11:25 AMapollo-testing-support for now then....confirmed tests runs for iOS as well now https://github.com/joreilly/StarWars/pull/20