事件:'test:summary'
¥Event: 'test:summary'
-
data
<Object>-
counts
<Object> 包含各种测试结果计数的对象。¥
counts
<Object> An object containing the counts of various test results.-
cancelled
<number> 取消的测试总数。¥
cancelled
<number> The total number of cancelled tests. -
failed
<number> 失败的测试总数。¥
failed
<number> The total number of failed tests. -
passed
<number> 通过的测试总数。¥
passed
<number> The total number of passed tests. -
skipped
<number> 跳过的测试总数。¥
skipped
<number> The total number of skipped tests. -
suites
<number> 运行的套件总数。¥
suites
<number> The total number of suites run. -
tests
<number> 运行的测试总数,不包括套件。¥
tests
<number> The total number of tests run, excluding suites. -
todo
<number> TODO 测试的总数。¥
todo
<number> The total number of TODO tests. -
topLevel
<number> 顶层测试和套件的总数。¥
topLevel
<number> The total number of top level tests and suites.
-
-
duration_ms
<number> 测试运行的持续时间(以毫秒为单位)。¥
duration_ms
<number> The duration of the test run in milliseconds. -
file
<string> | <undefined> 生成摘要的测试文件的路径。如果摘要对应多个文件,则此值为undefined
。¥
file
<string> | <undefined> The path of the test file that generated the summary. If the summary corresponds to multiple files, this value isundefined
. -
success
<boolean> 表示测试运行是否成功。如果发生任何错误情况,例如测试失败或未达到覆盖率阈值,则此值将设置为false
。¥
success
<boolean> Indicates whether or not the test run is considered successful or not. If any error condition occurs, such as a failing test or unmet coverage threshold, this value will be set tofalse
.
-
测试运行完成时触发。此事件包含与已完成的测试运行有关的指标,可用于确定测试运行是通过还是失败。如果使用流程级测试隔离,除了最终累积摘要之外,还会为每个测试文件生成一个 'test:summary'
事件。
¥Emitted when a test run completes. This event contains metrics pertaining to
the completed test run, and is useful for determining if a test run passed or
failed. If process-level test isolation is used, a 'test:summary'
event is
generated for each test file in addition to a final cumulative summary.