describe([name][, options][, fn])


  • name <string> 套件名称,报告测试结果时显示。 默认值: The name fn 的属性,如果 fn 没有名称,则为 '<anonymous>'
  • options <Object> 套件的配置选项。 支持与 test([name][, options][, fn]) 相同的选项
  • fn <Function> 套件下的函数。 声明所有子测试和子套件的同步函数。 默认值: 无操作的函数。
  • 返回: undefined

node:test 模块导入的 describe() 函数。 每次调用此函数都会在 TAP 输出中创建一个子测试和一个测试点。 调用顶层 describe 函数之后,所有顶层测试和套件都将执行

  • name <string> The name of the suite, which is displayed when reporting test results. Default: The name property of fn, or '<anonymous>' if fn does not have a name.
  • options <Object> Configuration options for the suite. supports the same options as test([name][, options][, fn])
  • fn <Function> The function under suite. a synchronous function declaring all subtests and subsuites. Default: A no-op function.
  • Returns: undefined.

The describe() function imported from the node:test module. Each invocation of this function results in the creation of a Subtest and a test point in the TAP output. After invocation of top level describe functions, all top level tests and suites will execute