出于所有实际目的,没有名为的JS函数
test.only
。更有可能的是,有一个顶级对象的名称为
test
,它有一个名为
only
@js.native
@JSGlobal("test")
object JestTest extends js.Object {
def only(str: String, function: js.Function0[_]): Unit = js.native
}
测验
apply
方法:
@js.native
@JSGlobal("test")
object JestTest extends js.Object {
// This is the test(...) function
def apply(str: String, function: js.Function0[_]): Unit = js.native
// This is the test.only(...) function
def only(str: String, function: js.Function0[_]): Unit = js.native
}
@js.native
@JSGlobalScope
object JestGlobal extends js.Object {
@js.native
object test extends js.Object {
// This is the test(...) function
def apply(str: String, function: js.Function0[_]): Unit = js.native
// This is the test.only(...) function
def only(str: String, function: js.Function0[_]): Unit = js.native
}
def expect[T](in: T): Matcher[T] = js.native
}