Skip to content

Commit

Permalink
Add test ensure all composables are in compose package
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Sep 29, 2023
1 parent 5165f23 commit a4f433a
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.mullvad.mullvadvpn.test.arch.compose

import androidx.compose.runtime.Composable
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf
import com.lemonappdev.konsist.api.verify.assert
import org.junit.Test

class ComposeTests {
@Test
fun `all app composables are in the compose packages`() {
allAppComposeFunctions().assert {
it.fullyQualifiedName.startsWith("net.mullvad.mullvadvpn.compose")
}
}

private fun allAppComposeFunctions() =
Konsist.scopeFromProduction("app").functions().withAllAnnotationsOf(Composable::class)
}

0 comments on commit a4f433a

Please sign in to comment.