https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Javier

12/11/2020, 7:09 PM
Is it possible to avoid common tests running on a specific platform?
r

russhwolf

12/11/2020, 7:39 PM
You can do something like
Copy code
@OptionalExpectation
expect annotation class JsIgnore
and then only actualize it in JS (for example)
Copy code
actual annotation class JsIgnore = kotlin.test.Ignore
👍 2
I got halfway to building a library around that a while back but wasn't convinced it'd be useful enough to be worth maintaining
j

Javier

12/11/2020, 7:59 PM
I think it can be interesting, is it public in your GitHub?
r

russhwolf

12/11/2020, 8:00 PM
I don't think I have it up anywhere. If I do it's pretty old
I tried to do it as a gradle plugin so that it could generate annotations based on your source-sets. It got messy getting it to work for Android because the Android gradle plugin behaves differently than most other platforms
👍 1
2 Views