jeudi 31 octobre 2019

Kotlin js test don't export main module

I try to run tests with last kotlin js plugin. A "build.gradle" was created by IDEA master:

plugins {
    id 'org.jetbrains.kotlin.js' version '1.3.50'
}

group 'ru.altmaea'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
    testImplementation "org.jetbrains.kotlin:kotlin-test-js"
}

kotlin.target.browser { }

When test doesn't use main module it works and throws correct fail:

import kotlin.test.Test
import kotlin.test.assertEquals

class IndexTest{

    @Test
    fun testOne() {
        assertEquals("11", "22")
    }

}

When i added to test a var from main module and run a "test" task, no tests were made and no error messages:

    @Test
    fun testTwo() {
        assertEquals("11", x)
    }

where x is defined in the main module.

MCVE.

how is it possible to perform a "testTwo"?

Aucun commentaire:

Enregistrer un commentaire