diff --git a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt index 32fe3d76505d..12f88ceb28cf 100644 --- a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt +++ b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt @@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.test.arch import androidx.lifecycle.ViewModel import com.lemonappdev.konsist.api.Konsist +import com.lemonappdev.konsist.api.ext.list.functions import com.lemonappdev.konsist.api.ext.list.modifierprovider.withPublicOrDefaultModifier import com.lemonappdev.konsist.api.ext.list.properties import com.lemonappdev.konsist.api.ext.list.withAllParentsOf @@ -23,6 +24,13 @@ class ViewModelTests { } } + @Test + fun ensurePublicFunctionsHaveNoReturnType() { + allViewModels().functions().withPublicOrDefaultModifier().assert { function -> + function.hasReturnType.not() + } + } + private fun allViewModels() = Konsist.scopeFromProject().classes().withAllParentsOf(ViewModel::class)