Conversation
- Mockk, Coroutines Test 라이브러리 의존성을 추가 - 테스트 시 Android 프레임워크에 의존적인 코드에 대해 기본 값을 반환하도록 `testOptions`를 설정
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
app/build.gradle.kts
Outdated
| testOptions { | ||
| unitTests.isReturnDefaultValues = true | ||
| } |
There was a problem hiding this comment.
당시에 로컬 unit test에서 Android 플랫폼 API를 건드리는 코드가 있어서, 예외로 테스트가 터지니까 일단 기본값으로 바꿔서 테스트를 돌리려고 임의로 넣어뒀던 설정입니다.
또한 옵션은 null 혹은 0으로 흘러가면서 버그가 가려질 수 있어서 해당 옵션 삭제하였습니다!
9804de8
https://developer.android.com/training/testing/local-tests#error
| dependencies { | ||
| implementation(projects.core.common) | ||
| implementation(projects.data.library) | ||
| testImplementation(libs.junit) |
There was a problem hiding this comment.
c: 앞으로 테스트를 어느범위까지 적용시킬 생각이신가요?
범위에 따라 테스트 의존성을 플러그인에 추가해도 좋을 것 같아서요
There was a problem hiding this comment.
현재는 도메인 레이어 모델과 하나의 UseCase에 대해서만 로컬 유닛 테스트를 작성한 상태입니다.
추후 테스트 범위가 확장될 경우에는 의존성 관리 방식도 함께 정리하여, 모듈별 개별 추가보다는 공통 플러그인으로 관리하는 방향을 고려하겠습니다..!
|
|
||
| class AttractivePointsTest { | ||
|
|
||
| @Test |
There was a problem hiding this comment.
c: 이 아래로 gwt주석이 없는데, 유즈케이스 테스트랑 코드 스타일이 통일되면 좋을 것 같아요 주석이 다 있거나 아예 다 없거나!
개인적으론 유즈케이스에서 gwt로 문단나눠주신게 더 잘 읽혔습니다!
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴