“Test events were not received” when run tests using Intellij

前端 未结 13 2272
花落未央
花落未央 2021-02-06 21:11

I have a Kotlin project and when I run my JUnit tests, I can\'t see tests execution result in IntelliJ and get this message instead:

test events were not

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 21:44

    For those who still might have this problem using IntelliJ & Kotlin:

    Add the following lines to the build.grade.kts. I hope it helps some of you.

    dependencies {
        testImplementation(kotlin("test-junit5"))
        testImplementation(platform("org.junit:junit-bom:5.7.0"))
        testImplementation("org.junit.jupiter:junit-jupiter")}
    tasks.test {
        useJUnitPlatform()
        testLogging {
            events("passed", "skipped", "failed")
        }
    }
    

    PS: without adding the "task." before test{...} I was getting the following error!

    the function invoke() is not found

提交回复
热议问题