what access modifier should unit tests have ?
# announcements
l
what access modifier should unit tests have ?
c
public
n
@LastExceed I think public with
@VisibleForTesting
annotation. Try out with private and protected too. I am not sure https://developer.android.com/reference/kotlin/androidx/annotation/VisibleForTesting
j
@VisibleForTesting
is for when you change the visibility of something you’re testing (the class/method under test) needs to be made public in order to make it testable. I believe when using Java, using it can give you warning. It’s essentially a note to other developer to explain why something has a relaxed visibility
l
ty
h
Maybe i'm a little late now, but how about
internal
? If someone else uses your module, then they probably don't care about your tests.
c
the tests are not exported anyway.
👍 1
👍🏻 1