I notice that, when I'm using `StringSpec` and I h...
# kotest
j
I notice that, when I'm using
StringSpec
and I have a particularly long test name, and split it up on separate lines, like this:
Copy code
"Given blah blah blah blah blah blah" + 
    " - When blah blah blah" + 
    " - Then blah blah blah" {
    TODO()
}
Then the test name in the Intellij run window will be truncated to just
- Then blah blah blah
. To remedy, I tried putting the concatenation in parens:
Copy code
("Given blah blah blah blah blah blah" + 
    " - When blah blah blah" + 
    " - Then blah blah blah") {
    TODO()
}
This fixed the test name displayed in the run window. But the plugin no longer recognized the test, I think. Because it removed the single green arrow gutter icon from that test in IntelliJ. Is there a workaround that avoids both problems? Thanks!
s
I think we just need to flatten the name for display
Which version of kotest
j
@sam Kotest v 4.1.1 and Intellij Kotest Plugin v 1.0.5. Thanks! ``````
Kotest has a lot of test styles already. Would you be open to considering one more?
s
If it was sufficiently different yes
j
Cool!
The idea arises from the current use-case. I don't think it's already covered by existing styles. The motivation is this: The developer doesn't want to nest tests in a tree, because understanding such tests can require much visual scanning up and down through the tree of nested tests to figure out what the state of the SUT is when the test executes. But, the developer likes the readability of a test name (only the name, not the logic/setup of the test) that can be broken into multiple nested segments in the IDE, and that also appears as mutliple segments in the IntelliJ plugin. ``````
I'll illustrate...
s
Can you put it in an issue
On github
j
In the IDE it looks like this:
Copy code
"Given blah blah blah blah blah blah" + 
    " - When blah blah blah" + 
    " - Then blah blah blah" {
    TODO()
}

"Given blah blah blah blah blah blah" 
    " - When blah blah blah" 
        " - Then shake shake shake" {
    TODO()
}
Note how second test name differs only in the third line/segment. In the plugin it looks like this:
Copy code
Given blah blah blah blah blah blah 
    - When blah blah blah
        - Then blah blah blah

Given blah blah blah blah blah blah 
    - When blah blah blah
        - Then shake shake shake
I imagine this would require framework to somehow know that the unique name of a test is a combination of all the names of its segments. It should not think, for example that two names map to the same test because the first segment of both are the same.
@sam Yes, I'll post on Github. Thanks!