What is the easiest way to run js tests on mpp lib...
# javascript
a
What is the easiest way to run js tests on mpp librarary? I am completely unfamiliar with JS testing frameworks, so I need minimal gradle configuration to run tests from
jsTest
source set.
a
Yeah, I found it. Which one should I use. As I already said, I am completely unfamiliar with those. Also is it possible to integrate tests into
jsTest
task already present in mpp plugin?
r
I tried mocha so far. I am not familiar with the new MPP plugin though
r
kotlin-frontend-plugin theoretically supports both testing with karma and new mpp projects. But I have not tried such configuration.
a
Yes, I use it for the application, but now I want to test mpp library that does not use frontend plugin
d
I use some variation of this configuration for my mpp work, it is not well optimized but certainly gets the job done: https://github.com/DrewCarlson/kotlin-mobius/blob/d5b3a74cb8e438d18ee3b9dec6066b1f7dfa18b2/mobius-core/build.gradle#L53-L89
a
Thtanks. I've almost finished my own kts version
👍 1
d
a
The only problem I still have is how to translate this:
Copy code
//                    configurations["testCompile"].forEach {
//                        from(zipTree(it.absolutePath).matching { include("*.js") })
//                    }
I don't understand what configuration I should use inside js block
Seems to be working now
Here is the final working kts multiproject configuration with publications and tests: https://github.com/altavir/dataforge-core/blob/dev/build.gradle.kts
o
a
Thanks, I will look and maybe optimize my script later. Still the conversion from groovy to kts ins not always obvious