https://kotlinlang.org logo
#javascript
Title
# javascript
e

Edoardo Luppi

03/05/2024, 11:33 AM
What's the best path to implement custom testing support for K/JS? I've seen KGP uses a combination of
KotlinTest
and
KotlinJsTestFramework
. Is extending those base classes the way?
c

CLOVIS

03/05/2024, 1:18 PM
What do you mean by custom testing?
e

Edoardo Luppi

03/05/2024, 1:18 PM
Spawning a process that is not driven by Node.js.
c

CLOVIS

03/05/2024, 1:19 PM
Do you want to spawn that process from Gradle itself? What is that process for?
e

Edoardo Luppi

03/05/2024, 1:21 PM
In the context of what I'm doing, that is trying to integrate VS Code development, testing is performed by invoking the main VS Code executable and passing in the entry point JS script. So the custom test task cannot use Node.js.
c

CLOVIS

03/05/2024, 1:33 PM
Copy code
val yourCustomTestTask by tasks.registering(Exec::class) {
    workingDir.set("…")
    commandLine.set("…")
}

tasks.check {
    dependsOn(yourCustomTestTask)
}
https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html
e

Edoardo Luppi

03/05/2024, 1:33 PM
I already do that, but having a proper test task (extending from
AbstractTestTask
) is better
I suppose
KotlinTest
integrates with Gradle too
@Adam S is this what you want to do?
a

Adam S

04/06/2024, 6:39 PM
yes! Let's continue in the other thread