Test module does not compile to AMD format

Hi there,

I tried to compile my main and test sources to AMD, so that I can configure them with RequireJS.
To do so, I configured my build.gradle as follows:

sourceSets {
    main.kotlin.srcDirs += "src/main/kotlin"
    test.kotlin.srcDirs += "src/test/kotlin"
}

compileKotlin2Js {
    kotlinOptions.moduleKind = "amd"
    kotlinOptions.sourceMap = true
}

My main module correctly compiles to AMD, but my test module is plain.
Is this a bug or am I missing something?

I tried this with my Kotlin 1.1 example project: https://github.com/bascan/kotlin-js-example

Thanks!
Bas

There is another task called compileTestKotlin2Js. Try configuring it in addition to compileKotlin2Js

1 Like

It works! Thanks for your quick reply.