在intellij中使用kotest时“该表达式未使用”

问题描述

使用 Kotest 编写的这个 kotlin 测试,IntelliJ 显示警告“表达式未使用”并且语法着色不起作用。 此外,在运行测试时,未找到测试。

class TalentMatchServiceSpec : StringSpec() {

    init {


        "add 3 to 2 should give 5"
        {
            // Given integers 2 and 3
            val two = 2
            val three = 3

            // When adding both numbers
            val sum = two + three

            // Then the result is 5
            sum shouldBe 5
        }

    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)