what’s the suggested test framework to use for kot...
# android
s
what’s the suggested test framework to use for kotlin based android app
g
There are plenty of them. JUnit is de facto standard.
r
I'd try spek
for junit, and kappuccino for espresso
s
alright thanks let me take a look at them now
g
Spek experience can be not so smooth (especially on android) for now until 2.0 release, you can check talk about Spek on KotlinConf. Also, you cannot use it for instrumentation tests
r
i like Spek
@gildor what Issues did you run into with Spek? It doesn’t play well with Robolectric, but I think this point people should just use Espresso for instrumentation testing, and drop Robolectric in my opinion
And spek to test to test your business logic
s
still looking into spek, looks concise though
maybe thats cause of kotlin don't know
r
Kappuccino makes use of alot of high order functions but none of them are inline🤔
s
thinking though i can still write espresso in kotlin without using kappacinno
r
yea
g
@rkeazor I didn’t get your point. Spek requires Junit 5 and Junit 5 required Java 8, so you cannot use it for Instrumentation tests on Android until API level 26. Also Espresso is just view manipulation library, that allow to work with Android UI + integration with hamercrest assertions, so you can use any test runner, so don’t think that we should mix those different not-comparable tools I didn’t use Spek, I just know that it’s not so stable and even main contributors recommend to wait until version 2.0 dev preview. But I like concept and will probably use it in future I just think, that if you not familiar with testing in general and for first try just better to use Junit, it stable, works everywhere, part of instrumentation runner on Android and has great tooling support for every build system and every IDE. And when you will be more familiar with testing you will find better option yourself without asking other developers who, probably, has different requirements
r
@gildor isn’t for instrumentation tests
its focus was pure unit test
g
Spek is just specication framework integrated with Junit 5 test runner it doesn’t force to use particular test type (unit, instrumentation, integration). You can use it for any type of tests if you can run them, but you cannot do that on Android before api livel 26
junit in for unit tests, just check title, but still used for other test types
If Spek experience for you so good and you don’t have issues, good, but I just think that maybe library under active development is not the best recommendation for the first test library
r
lol which open source library isn’t under active development.I don’t know I used it and without problem .
I think they are doing a good job on it
g
under active, backward incompatable, development
r
when you say backwards incompatible what are you referring to? Junit 4?
g
Again, It’s good for you if you ready to use such library, even help with contribution, bug reporting etc. My point that it can be not so good for others, especially newbies
and when 2.0 dev preview will be released it will be backward incompatible with 1.x and it’s fine but make sense to wait release
Maybe I’m wrong and someone from contributors of Spek will correct me, but this what I understand now
r
You should try and make judgement about it
and what you don’t like, just make a contribution lol
g
I have nothing against Spek and want to use it. I judge only because main contributors of Spek telling about it and read #spek channel
r
I think its fine, I haven’t ran into problems.Except for robolectric issue. But like I said the main focus was pure junit. And at KotlinConf the main contributor encourage people to give it a shot
g
Yes, after version 2.0 dev preview
r
lol even before
its just a dsl, what you got to loose lol
g
Time
it’s not only dsl, it’s also Junit 5, IDE integration (including Spek plugin)
r
Perhaps, but it works .
do you use robolectric?
it uses the testRunner, its not Junit 5
g
No, I don’t, we use only pure unit + instrumentation
r
best thing, Robolectric has been the source of all my Nightmares 😂