Thanks for the great tool, it is extremely powerfu...
# konsist
d
Thanks for the great tool, it is extremely powerful! Thought I'd share some sweet Compose Preview tests that I found useful:
Copy code
class ComposePreviewTests {
    @Test
    fun ensureAllPreviewsArePrivate() {
        allPreviewFunctions().assert {
            it.hasPrivateModifier
        }
    }

    @Test
    fun ensureAllPreviewsStartWithPrefixPreview() {
        allPreviewFunctions().assert {
            it.name.startsWith("Preview")
        }
    }

    private fun allPreviewFunctions() = Konsist.scopeFromProject().functions().withAllAnnotations("Preview")
}
❤️ 2
i
Thx for the feedback and inspiration 🙏 I will add samples to the Android Snippets. BTW you can use
.withAnnotationOf(Preview::class)
to check by type rather than string.
d
Ah nice, thanks for the improvement 🙏
Regarding the android snippets, seems like they are not publicly accessible? Is this the intention?