Are there any guidelines on when you should run te...
# multiplatform
c
Are there any guidelines on when you should run tests for common code on all target platforms and when it is not needed? Context: In our mobile multiplatform app, our domain (use cases) are shared. This is just the business logic and there's no thread switch happening for example. The entire domain layer executes on a single thread. Currently we run these tests as JVM tests on the development host. Does it make sense to somehow test it on iOS as well, especially since this layer is not impacted by the memory model?
j
I often found issues while running tests in common over multiple platforms. Sometimes I find compiler issues for JS or native or indeed some unexpected freeze exceptions because of usage of mutables in objects. So I would recommend it.
4
k
I would always recommend running them for all target platforms. it's basically "free" (you've already written the tests).
1
r
Yeah, recommended. Getting them to run on all target platforms is a one-time cost, but being confident there aren’t obvious platform-specific problems is highly valuable
c
Okay. We're using Mockito for our tests. It is going to be an investment to make it work elsewhere
r
Good luck. 🙂 Should pay off in the long run. I ended writing a micro spy library myself for test-doubling in a multi-plat friendly way - hopefully ya’ll can find some better ready-made solutions
If you’re extensively using mockito’s features, switching can be a real pain 😰
k
there is mockk... of course it refuses to run in IDEA due to a bug in byte buddy, so that's a non-starter