事件:'test:diagnostic'


【Event: 'test:diagnostic'

  • data <Object>
    • column <number> | <undefined> 测试定义所在的列号,如果测试是通过 REPL 运行,则为 undefined
    • file <string> | <undefined> 测试文件的路径,如果测试是在 REPL 中运行,则为 undefined
    • line <number> | <undefined> 定义测试的行号,如果测试是通过 REPL 运行的,则为 undefined
    • message <string> 诊断信息。
    • nesting <number> 测试的嵌套层级。
    • level <string> 诊断消息的严重级别。可能的取值为:
      • 'info':信息类消息。
      • 'warn':警告。
      • 'error':错误。

当调用 context.diagnostic 时触发此事件。此事件保证按照测试定义的顺序触发。

【Emitted when context.diagnostic is called. This event is guaranteed to be emitted in the same order as the tests are defined.】