Is the Spek project alive? Or does it have some re...
# spek
e
Is the Spek project alive? Or does it have some replacement?
👍 1
b
Most folks are either using #kotest or built-in kotlin-test framework. Especially in kmp projects, there's nothing close to kotlin-test for now that would support test filtering properly on all platforms
e
@Big Chungus thank you for the response! Where can I read more about the filtering you mentioned?
b
Nowhere really, it's just that there's no 3p testing framework that supports running a single test out of the entire suite on kotlin native (none that I'm aware of at least). Most just build on top of junit5 (like spek and kotest) and just use it's test filtering engine
Other kmp platforms usually are then limited to only being able to filter down to a single test class, but not method
Plus there's also an issue of subpar ide integrations (if any) when you move away from kotlin-test
All of this does not apply to jvm as it has junit5 as a base to build on
e
are you talking about kotlin-test-common? can it be used with kotest?
b
Yes that and its friends.
It can be used with kotest-assertions if that's what you're asking
e
I don’t like the JUnit style frameworks which force you to create a separate method for each test. Sometimes it is not convenient. Spek-like frameworks allow to create much more readable tests. And it looks like Kotest allows to use that style in KMM. Am I wrong?
b
Correct, although kotest itself is also built on top of junit5 engine
And if you use kotest on kotlin-native, you will be limited by only being able to filter down to running a single test class, but not method
P.S. KMM is dead, long live KMP
e
Yes, this was a typo. I want to use it in a KMP project targeting Android and iOS.
b
That was just a silly joke, it doesn't matter all that much 😂
😀 1
In any case, kotest can work on full kmp, but all the times I've tried to like it I've ended up going back to kotlin-test
Even though I hate method based test structuring from junit too
e
Do you have some example how pure kotlin-test tests could look like?
b
Exactly the same as junit4 tests
Main downside is that it does not support parameterized tests on kmp
You have @Test and @Ignore annotations and that's it, it's pretty barebones but it works
Ok, there are few more plus basic assertions
👍 1
e
Tahnk you!