Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
558 stars 42 forks source link

Generate externals does not work for test npm dependencies #431

Open fullkomnun opened 3 years ago

fullkomnun commented 3 years ago

When declaring a NPM dependency using both Legacy and IR JS compiler types - the following dukat tasks are created : js(Legacy/Ir)GenerateExternals(Integrated). If the NPM dependency is a 'main' source set dependency, and configured to generate externals - externals are indeed generated for that dependency (either implicitly or explicitly). However, if it is a 'test' source set dependency - externals are not generated. example:

val jsTest by getting {
    kotlin.srcDir("src/jsTest")
    dependsOn(commonTest)
    dependencies {
        implementation(kotlin("test-js"))
        implementation(npm("testcontainers", "6.4.0", generateExternals = true))
    }
}

Gradle: 6.7.1 Kotlin: 1.4.21

maggie-weber commented 2 years ago

Running into the same issue when trying to generate external definitions within jsTest.


        val jsTest by getting {
            dependencies {
                implementation(npm("testcontainers", "8.13.1", generateExternals = true))
            }
        }