跳转到主要内容

TestError

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


属性

cause

新增于: v1.49 testError.cause

错误原因。当错误存在 cause 时设置。如果不存在 cause 或 cause 不是 Error 的实例,则为 undefined

用法

testError.cause

类型


location

添加于:v1.30 testError.location

源代码中的错误位置。

用法

testError.location

类型


message

新增于: v1.10 testError.message

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

用法

testError.message

类型


snippet

新增于:v1.33 testError.snippet

带有高亮错误的源代码片段。

用法

testError.snippet

类型


stack

新增于: v1.10 testError.stack

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

用法

testError.stack

类型


value

新增于: v1.10 testError.value

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

用法

testError.value

类型