Skip to main content

TestError

有关测试执行期间引发的错误的信息。

¥Information about an error thrown during test execution.


属性

¥Properties

cause

Added in: v1.49 testError.cause

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

¥Error cause. Set when there is a cause for the error. Will be undefined if there is no cause or if the cause is not an instance of Error.

用法

¥Usage

testError.cause

类型

¥Type


location

Added in: v1.30 testError.location

源代码中的错误位置。

¥Error location in the source code.

用法

¥Usage

testError.location

类型

¥Type


message

Added in: v1.10 testError.message

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

¥Error message. Set when Error (or its subclass) has been thrown.

用法

¥Usage

testError.message

类型

¥Type


snippet

Added in: v1.33 testError.snippet

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

¥Source code snippet with highlighted error.

用法

¥Usage

testError.snippet

类型

¥Type


stack

Added in: v1.10 testError.stack

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

¥Error stack. Set when Error (or its subclass) has been thrown.

用法

¥Usage

testError.stack

类型

¥Type


value

Added in: v1.10 testError.value

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

¥The value that was thrown. Set when anything except the Error (or its subclass) has been thrown.

用法

¥Usage

testError.value

类型

¥Type