Is there a good sample to look at for JS and multi...
# multiplatform
k
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
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
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
I started with that plugin 🙂
r
haha fair enough
k
They definitely don't run. I tried some different gradle tasks but no luck so far
h
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
you can run the kotlin.test Tests with mocha for instance
k
Ah, OK. Will take a look. Thanks.
e
@kpgalligan Okio has JS tests
👍 2
n
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