事件:'test:summary'
【Event: 'test:summary'】
data<Object>counts<Object> 一个包含各种测试结果计数的对象。duration_ms<number> 测试运行的持续时间(毫秒)。file<string> | <undefined> 生成摘要的测试文件路径。如果摘要对应多个文件,则此值为undefined。success<boolean> 表示测试运行是否被视为成功。如果发生任何错误情况,例如测试失败或未达到覆盖率阈值,该值将被设置为false。
在测试运行完成时触发。当测试运行完成时,该事件包含相关的指标,对于判断测试运行是通过还是失败非常有用。如果使用进程级测试隔离,则每个测试文件都会生成一个 '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.】