事件:'test:complete'
¥Event: 'test:complete'
-
data
<Object>-
column
<number> | <undefined> 定义测试的列号,如果测试是通过 REPL 运行的,则为undefined
。¥
column
<number> | <undefined> The column number where the test is defined, orundefined
if the test was run through the REPL. -
details
<Object> 额外的执行元数据。¥
details
<Object> Additional execution metadata.-
passed
<boolean> 测试是否通过。¥
passed
<boolean> Whether the test passed or not. -
duration_ms
<number> 以毫秒为单位的测试持续时间。¥
duration_ms
<number> The duration of the test in milliseconds. -
error
<Error> | <undefined> 如果测试未通过,则封装测试抛出的错误。¥
error
<Error> | <undefined> An error wrapping the error thrown by the test if it did not pass. -
type
<string> | <undefined> 测试的类型,用于指示这是否是一个套件。¥
type
<string> | <undefined> The type of the test, used to denote whether this is a suite.
-
-
file
<string> | <undefined> 测试文件的路径,如果测试是通过 REPL 运行的,则为undefined
。¥
file
<string> | <undefined> The path of the test file,undefined
if test was run through the REPL. -
line
<number> | <undefined> 定义测试的行号,如果测试是通过 REPL 运行的,则为undefined
。¥
line
<number> | <undefined> The line number where the test is defined, orundefined
if the test was run through the REPL. -
name
<string> 测试名称。¥
name
<string> The test name. -
nesting
<number> 测试的嵌套级别。¥
nesting
<number> The nesting level of the test. -
testNumber
<number> 测试的序号。¥
testNumber
<number> The ordinal number of the test. -
todo
<string> | <boolean> | <undefined> 如果调用context.todo
,则存在¥
todo
<string> | <boolean> | <undefined> Present ifcontext.todo
is called -
skip
<string> | <boolean> | <undefined> 如果调用context.skip
,则存在¥
skip
<string> | <boolean> | <undefined> Present ifcontext.skip
is called
-
当测试完成执行时触发。此事件的触发顺序与测试定义的顺序不同。对应的声明有序事件是 'test:pass'
和 'test:fail'
。
¥Emitted when a test completes its execution.
This event is not emitted in the same order as the tests are
defined.
The corresponding declaration ordered events are 'test:pass'
and 'test:fail'
.