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

Mikolaj

03/26/2024, 6:27 AM
Hi! Is it possible to remove
jsTest
source set from project? I am adding javascript target to existing library and jsTests do not compile due to usage of mockk. I wish i could remove the jsTest for now. Can it be done?
e

Edoardo Luppi

03/26/2024, 2:01 PM
What you're saying is you introduced the JS target, but mockk isn't compatible with JS, and thus tests in
commonTest
fails when they get compiled for JS?
m

Mikolaj

03/26/2024, 2:13 PM
exactly. I get unresolved refference when tests are compiled on js target. I managed to work around it by calling
./gradlew build -x compileTestKotlinJs
but this is far from ideal. I actually do not need to test common code on JS for now (and maybe ever) so it would be nice to get rid of jsTest completly
e

Edoardo Luppi

03/26/2024, 2:34 PM
Example of a possible solution:
Copy code
testTask {
  useMocha {
    ...
  }

  enabled = false
  compilation.compileTaskProvider.get().enabled = false
}
👀 1
m

Mikolaj

03/27/2024, 7:19 AM
Thank You very much. Adding the
compilation.compileTaskProvider.get().enabled = false
helped 🙌
2 Views