跳转到主要内容

TestError

关于测试执行期间抛出的错误的信息。


属性

原因

新增于: v1.49 testError.cause

错误的原因。当错误有原因时设置。如果错误没有原因,或者原因不是Error的实例,则为undefined

用法

testError.cause

类型


位置

添加于:v1.30 testError.location

源代码中的错误位置。

用法

testError.location

类型


消息

新增于: v1.10 testError.message

错误消息。当抛出Error(或其子类)时设置。

用法

testError.message

类型


代码片段

新增于:v1.33 testError.snippet

带有突出显示错误的源代码片段。

用法

testError.snippet

类型


堆栈

新增于: v1.10 testError.stack

错误堆栈。当抛出Error(或其子类)时设置。

用法

testError.stack

类型


新增于: v1.10 testError.value

抛出的值。当抛出除Error(或其子类)之外的任何内容时设置。

用法

testError.value

类型