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

Amanjeet Singh

04/19/2020, 1:34 PM
I am not able to run my tests in commonTest. Am I missing some setup in configuration in Android studio?
v

vanniktech

04/19/2020, 1:41 PM
I can’t run them either
s

saket

04/19/2020, 3:26 PM
Testing support in the IDE is very flaky right now. You’ll have to rely on the command line for runnign your tests.
👍 2
b

Brendan Weinstein

04/19/2020, 4:27 PM
intellij > as for kmp
a

Amanjeet Singh

04/19/2020, 7:05 PM
Thanks @saket that worked 🙂
e

emmano

04/19/2020, 8:46 PM
If you make your common test
abstract
you can extend it inside
androidTest
(this being the source set where you have android specific tests) and it will run from Android Studio.
👍 1
j

Jess Brent

04/21/2020, 5:58 PM
small side note, someone can correct me if i just did something wrong, but if you’re going to be targeting js, your tests won’t compile with ` in the function names (illegal character). i used underscores to get around that
s

saket

04/21/2020, 6:01 PM
would that be the case for all non-JVM targets?
j

Jess Brent

04/21/2020, 6:02 PM
not quite sure, maybe someone else can chime in, i’m only targeting jvm/js right now 🙂
e

emmano

04/21/2020, 6:30 PM
You can still use the ` notation and use
@JsName()
to specify a test name for JS targets
They explain how to do it here since the original
@JsName
is not part of the common module
j

Jess Brent

04/21/2020, 6:32 PM
thank you!
👍 2