https://kotlinlang.org logo
#kotest
Title
# kotest
d

dave08

04/27/2021, 1:06 PM
It seems like the Kotest intellij plugin's test browser ignores the context blocks in DescribeSpec...
w

wasyl

04/27/2021, 1:25 PM
Also it ignores context blocks when determining if tests have the same name
d

dave08

04/27/2021, 1:44 PM
Yup, that's the first thing I noticed... but it's probably related.
s

sam

04/28/2021, 12:13 PM
The context thing is fixed in the latest update (pending approval with Jetbrains)
👍🏼 1
@wasyl in 4.5 duplicated names get the (1) (2) treatment like data tests
w

wasyl

04/28/2021, 12:23 PM
Just for clarity, the duplicated test warning is a false positive as the plugin doesn’t understand
context
blocks. So it should also be fixed after the update 🙂
d

dave08

04/28/2021, 12:23 PM
So the IDE won't complain anymore for real duplicates in 4.5?
s

sam

04/28/2021, 12:23 PM
correct @dave08. Do you think that's an issue? Duplicated test names seemed an edge case to me - we errored because junit would just "hide them" (which is awful)
In 4.5, I made it append (1) or (2) and so on, so they have a unique name
That's required for data tests where you re-use parameters, but I could add an option to error on duplicated names as before if we think that's valuable
d

dave08

04/28/2021, 12:25 PM
But sometimes a test is copy-pasted, the inners are changed and the name isn't 😛... so the IDE complaining is good in a sense...
s

sam

04/28/2021, 12:25 PM
Yeah, but it just means your test output would be "test I copied" and "test I copied (1)"
4.5 isn't released yet so I can still add the option in if we want
d

dave08

04/28/2021, 12:26 PM
Maybe if the (1) was a prefix, it would be more noticeable...
s

sam

04/28/2021, 12:26 PM
yes I like that as well
d

dave08

04/28/2021, 12:31 PM
And possibly an IDE warning? A setting might be a plus though, because some (like me), never use duplicate names and prefer the IDE and test crashing to tell them... The only occasion where I came across doubles was with
table()
tests that the only difference was the number of commas in the name...
s

sam

04/28/2021, 12:58 PM
We'll do this before 4.5 final https://github.com/kotest/kotest/issues/2229
👍🏼 1
2 Views