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

kpgalligan

10/22/2018, 2:03 PM
Is there a good sample to look at for JS and multiplatform? I have KotlinJS in multiplatform library code but have no idea how to actually run tests. Library seems to build fine and publish, but no tests ever run for the JS portion.
yet, the tooling is not yet were it should be IMO. For instance: https://youtrack.jetbrains.com/issue/KT-27700
k

kpgalligan

10/22/2018, 2:08 PM
Thanks. I'm thinking more like with the MPP plugin and running the kotlin.test.Test tests. Right now jvm and native both run their tests when you build on command line, but JS does not.
r

russhwolf

10/22/2018, 2:08 PM
IDEA EAP has a multiplatform library template that includes JS tests. Not convinced they're actually running though because I can't seem to make the build fail with an
assertTrue(false)
But maybe there's some hints for you in there
k

kpgalligan

10/22/2018, 2:09 PM
I started with that plugin 🙂
r

russhwolf

10/22/2018, 2:09 PM
haha fair enough
k

kpgalligan

10/22/2018, 2:12 PM
They definitely don't run. I tried some different gradle tasks but no luck so far
h

h0tk3y

10/22/2018, 2:19 PM
At this point, the Kotlin Gradle plugin actually does not run the JS tests, mostly because there's a lot of ways to run JS tests, and different choices of a framework require different configuration. So, currently, you can manually configure the JS tests. One example can be found here: https://youtrack.jetbrains.com/issue/KT-26914#focus=streamItem-27-3080848-0-0
r

robstoll

10/22/2018, 2:19 PM
you can run the kotlin.test Tests with mocha for instance
k

kpgalligan

10/22/2018, 2:20 PM
Ah, OK. Will take a look. Thanks.
e

egorand

10/22/2018, 5:07 PM
@kpgalligan Okio has JS tests
👍 2
n

napperley

11/10/2018, 12:30 AM
Can see a example of testing with Kotlin JS in MPP (using the old plugin) here: https://gitlab.com/webscene/webscene-core/tree/master/js/src/test/kotlin
2 Views