Is it possible to get better IntelliJ support for ...
# javascript
r
Is it possible to get better IntelliJ support for kotlinjs tests as a small project on the roadmap? There are several bugs (https://youtrack.jetbrains.com/issue/KTIJ-27949, https://youtrack.jetbrains.com/issue/KTIJ-9304, https://youtrack.jetbrains.com/issue/KTIJ-27307/, arguably also https://youtrack.jetbrains.com/issue/KT-31799) that make quality of life worse (than Jest/Typescript, even)
a
For the quoted identifiers, could you please try to turn on
JsAllowInvalidCharsIdentifiersEscaping
language feature. You could do it by the next code in your `build.gradle.kts`:
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
    kotlinOptions {
        freeCompilerArgs += "-XXLanguage:+JsAllowInvalidCharsIdentifiersEscaping"
    }
}
Soon, it will be enabled by default
r
@Artem Kobzar thanks, that does resolve that issue. 🤞 the rest can be tackled soon - it's barely usable right now (there's not even test controls in test files - run/debug etc.)
e
@Reuben Firmin to enable gutter icons you need to enable experimental multiplatform features via Settings.
r
thanks, that worked. here's another related ticket to get minimum functionality for kjs tests in place: https://youtrack.jetbrains.com/issue/KTIJ-15528
e
I agree that JS test support could be improved, although I think the current state of things is pretty decent. I've yet to find myself in a situation where I can't test something.
r
I really disagree. debugging is broken, assertion comparison is broken, they don't have sourcesmaps, all tests run twice
it's true that you can launch tests and use printlin statements to figure out where something broke. but that's a terrible developer experience, compared to JVM or event typescript/jest
e
Not my experience.
Debugging is broken
You mean you can't debug when running JS tests? If that's the case it's strange because I do it daily. It's true that coroutine heavy code sometimes fails to stop at breakpoints tho.
All tests run twice
This is just an IDE artifact, so you don't need to worry about double execution. Gradle will run them only once.
Don't have source maps
What's your use case for source maps during testing?
r
see all the linked tickets 🙂
e
If it's for better stack traces, I can agree on that.
Related to debugging coroutine code, suspending functions, etc., use Force Step Over to avoid the debugger skipping breakpoints and going directly to the end of the execution.
r
that's helpful. though the issue i get is it hard crashing (27949). intellij support were able to repro