You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ViewModelTest init 블럭내에 Channel send Turbine 관련 이슈
app.cash.turbine.TurbineAssertionError: No value produced in 3s
awaitComplete() -> cancelAndIgnoreRemainingEvents() 로 변경하여 해결
awaitComplete: 테스트 대상 Flow가 완전히 완료(complete)될 때까지 기다림.
cancelAndIgnoreRemainingEvents(): 테스트를 강제로 종료하고(Flow의 수집을 취소) 남은 이벤트를 무시
이벤트 중간 중간에 TestCoroutineScheduler.advanceUntilIde() 함수를 호출하여 이벤트 호출을 완료
ViewModelTest Navigation Argument + SavedStateHandle 관련 이슈(화면 이동시 전달받는 인자)
kotlinx.serialization.MissingFieldException: Fields [bandalartId, bandalartTitle, bandalartProfileEmoji, bandalartChartImageUri] are required for type with serial name 'com.nexters.bandalart.core.navigation.Route.Complete', but they were missing
CompleteViewModelTest savedStateHandle 모킹 관련 이슈
Verification failed: call 1 of 1: BandalartRepository(#4).upsertBandalartId(eq(1), eq(true), any())) was not called java.lang.AssertionError: Verification failed: call 1 of 1: BandalartRepository(#4).upsertBandalartId(eq(1), eq(true), any())) was not called
CommonTest dependencies 내에 JUnit5 + mockk 관련 의존성 cannot resolve 관련 이슈
Room Database 관련 Test Code 작성을 위한 Context 주입 관련 이슈
The exception "java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation." is thrown.https://stackoverflow.com/questions/75917684/android-room-database-junit5-test
https://zenn.dev/yass97/articles/96bc480590be4b
-> junit5-robolectric-extension 라이브러리를 도입하여 해결
ViewModelTest init 블럭내에 Channel send Turbine 관련 이슈
app.cash.turbine.TurbineAssertionError: No value produced in 3sawaitComplete()->cancelAndIgnoreRemainingEvents()로 변경하여 해결awaitComplete: 테스트 대상 Flow가 완전히 완료(complete)될 때까지 기다림.
cancelAndIgnoreRemainingEvents(): 테스트를 강제로 종료하고(Flow의 수집을 취소) 남은 이벤트를 무시
TestCoroutineScheduler.advanceUntilIde()함수를 호출하여 이벤트 호출을 완료ViewModelTest Navigation Argument + SavedStateHandle 관련 이슈(화면 이동시 전달받는 인자)
kotlinx.serialization.MissingFieldException: Fields [bandalartId, bandalartTitle, bandalartProfileEmoji, bandalartChartImageUri] are required for type with serial name 'com.nexters.bandalart.core.navigation.Route.Complete', but they were missingVerification failed: call 1 of 1: BandalartRepository(#4).upsertBandalartId(eq(1), eq(true), any())) was not called java.lang.AssertionError: Verification failed: call 1 of 1: BandalartRepository(#4).upsertBandalartId(eq(1), eq(true), any())) was not calledNo answer found for:
...continuation {})mockk/mockk#957HomeViewModelTest 관련 이슈
검증부 (assert / expect)는 하드코딩한다
UI Test 관련 이슈
reference)
https://github.com/DroidKaigi/conference-app-2024