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


  • name <string> 套件名称,报告测试结果时显示。默认值:fnname 属性,如果 fn 没有名称,则为 '<anonymous>'

    ¥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> 套件的可选配置选项。这支持与 test([name][, options][, fn]) 相同的选项。

    ¥options <Object> Optional configuration options for the suite. This supports the same options as test([name][, options][, fn]).

  • fn <Function> | <AsyncFunction> suite 函数声明嵌套测试和套件。此函数的第一个参数是 SuiteContext 对象。默认值:空操作函数。

    ¥fn <Function> | <AsyncFunction> The suite function declaring nested tests and suites. The first argument to this function is a SuiteContext object. Default: A no-op function.

  • 返回:<Promise> 立即满足 undefined

    ¥Returns: <Promise> Immediately fulfilled with undefined.

suite() 函数是从 node:test 模块导入的。

¥The suite() function is imported from the node:test module.