suite([name][, options][, fn])
-
name
<string> 套件名称,报告测试结果时显示。默认值:fn
的name
属性,如果fn
没有名称,则为'<anonymous>'
。¥
name
<string> The name of the suite, which is displayed when reporting test results. Default: Thename
property offn
, or'<anonymous>'
iffn
does not have a name. -
options
<Object> 套件的可选配置选项。这支持与test([name][, options][, fn])
相同的选项。¥
options
<Object> Optional configuration options for the suite. This supports the same options astest([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 aSuiteContext
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.