Thread
#multiplatform
    t

    thana

    3 years ago
    can my e.g.
    jsTest
    depend on the
    commonTest
    set of a different module? i'd like to provide some common test files for several modules...
    a

    Alexey Belkov [JB]

    3 years ago
    Haven't tried it, but I believe the answer is no, for the same reason as https://kotlinlang.slack.com/archives/C19FD9681/p1559290001004200
    t

    thana

    3 years ago
    Well no. i don;t want to add any transitive dependencies. also "it doesn't" make much sense" is not a good reason to forbid it
    russhwolf

    russhwolf

    3 years ago
    It’s possible to share test code between modules by created a separate
    sharedTests
    module that defines your tests in
    commonMain
    , and then depending on
    :sharedTests
    from the test code of other modules. There’s some rough edges though. For example if you try this in JS on 1.3.40 you’ll very likely run into https://youtrack.jetbrains.com/issue/KT-31917
    I had a configuration like that in Multiplatform Settings, but removed it in the 1.3.40 update due to that and another similar issue on native. Currently I share test code via
    kotlin.srcDirs()
    but the IDE complains when files are duplicated across multiple sourceSets/modules in that way.
    t

    thana

    3 years ago
    Thank you! I wonder why sharing code in tests is so hard...