Hi all, I am wondering what testing framework are ...
# getting-started
j
Hi all, I am wondering what testing framework are you using in the project now, like mockk/mockito/kotest~~~
🙂 1
a
Mockk/Kluent
j
Thx Rios,any other lib is popular also
g
To be pedantic mockk is not testing framework, it’s mocking library What kind area of testing you are interested? There are many aspects of testing
j
Framework, mock, assertions or other aspects😆
I am learning testing
m
My old teams used Mockito (for familiarity, coming from Java), but I also know people that love using Mockk (especially with Kotlin). Also, JUnit as a testing framework.
g
If you learning testing, I would recommend to stick for first time with pure Junit for everyting (if you on JVM) and learn basics, because it has the largest support, works everywhere, and there are recipes for all situation on Google. Because JUnit is testng framework, it has everything what you need to lear and understand testing And try to keep distance from mocking libraries until you confident with general testing principals and try to use fake/stubs instead, it’s very easy to abuse those, especially for beginners
K 1
2
❤️ 1
n
Junit5/Mockk/Kotest-assertions for me.
d
Kotest + Mockative
j
Thx so much, guys!!🥰
v
Since I know Spock framework, I exclusively use it for all testing where possible, because it actually makes testing fun again and also has stubbing and mocking integrated nicely right away
When testing Kotlin code it has the same drawback than any other non-Kotlin consumer, that it does not nicely handle default parameter values though
g
I would agree with Björn, but I wouldn’t recommend Spock or other specification framework as first testing approach, at least if you don’t have other colleagues who can help you with it
v
Really? It imho is much easier than using JUnit or similar, even without mocking and stubbing. And it has amazing information if you have a failure that you have a hard time to get with other frameworks. I would indeed recommend it as first testing approach. 🙂
g
I disagree, but would be like to be mistaken 🙂
still, Junit hundreds times more popular on JVM, so it really depends on what is goal of studying of testing
v
Definitely more popular, but undeserved. 😄 So let's spread it. If he now starts using JUnit, he might stick with it and not come to the light side later. 😄
d
Different kinds of test, different tools. Not every tests in real life fit the spec style.
g
Because it may be undeserved, but if 99/100 projects use it, you have to know at least basics of it, nobody prevents you to learn another approaches
👍 1
v
Not every tests in real life fit the spec style.
Actually I didn't hit any test I wanted to write not fitting Spock yet. Either
when: ... then: ...
or
expect: ...
always matched. But maybe I just didn't write the non-fitting tests yet. 🙂
m
Maybe the question is what exactly @Jerry Yion is interested in learning about testing? 😉