Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate nested tests #146

Closed
Hives opened this issue Feb 21, 2020 · 3 comments · Fixed by #234
Closed

Indicate nested tests #146

Hives opened this issue Feb 21, 2020 · 3 comments · Fixed by #234
Assignees
Labels
Milestone

Comments

@Hives
Copy link

Hives commented Feb 21, 2020

Is it possible to indicate the nesting of @Nested tests by indenting them under their parent?

Here's the current output we're getting:
image

The first nested block could be indented once, and the second nested block indented twice, and so on.

Here's what that looks like using the IntelliJ test runner - nested tests are clearly displayed as children of the parent level:
image

Example tests used to produce this output:

@Nested
@DisplayName("Outer block")
internal class TestTest {

    @Test
    fun `Test in the outer block`() {
        assertThat(1 + 1).isEqualTo(2)
    }

    @Nested
    @DisplayName("First block")
    inner class FirstBlock {

        @Test
        fun `Test in the first nested block`() {
            assertThat(1 + 1).isEqualTo(2)
        }

        @Nested
        @DisplayName("Second block")
        inner class SecondBlock {

            @Test
            fun `Test in the second nested block`() {
                assertThat(1 + 1).isEqualTo(2)
            }
        }
    }
}

Thanks

@Hives Hives added the feature label Feb 21, 2020
@Hives Hives changed the title Display nested tests Indicate nested tests Feb 21, 2020
@radarsh
Copy link
Owner

radarsh commented Feb 21, 2020

I've been doing some experimentation and it seems very much feasible.

@Hives
Copy link
Author

Hives commented May 5, 2020

hi @radarsh. did you ever get around to looking at this?

@radarsh
Copy link
Owner

radarsh commented May 6, 2020

Half way into this. One of the scenarios is turning out to be more complicated than I thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants