Display passed Test names in Android Studio Unit Test - JUnit5 with Kotlin

Viewed 31

I'm learning on JUnit5 with Kotlin, and I wrote a test code with special names as function names using the back tick but nothing was displayed for passed tests. I used the annotation of @DisplayName("something") that didn't display any name of passed tests.

i always get this empty list of tests

enter image description here

here is the code

@DisplayName("A special test case")
class DisplayNameTest {

    @Test
    @DisplayName("First Test")
    fun `First Test with normal name`() {}

    @Test
    @DisplayName("(╯°Д°)╯")
    fun `Second Test with Special Characters`() {}

    @Test
    @DisplayName("😊")
    fun `Test name including an Emoji`() {}

}
1 Answers

Click that check mark above the results to show passing tests

The button enabled and several passed tests displayed

It's just that usually, you only care about the failing ones!

Related