describe([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> Configuration options for the suite. supports the same options astest([name][, options][, fn])
. -
fn
<Function> | <AsyncFunction> 套件下的函数声明所有子测试和子套件。此函数的第一个参数是SuiteContext
对象。默认值:空操作函数。¥
fn
<Function> | <AsyncFunction> The function under suite declaring all subtests and subsuites. The first argument to this function is aSuiteContext
object. Default: A no-op function. -
返回:<Promise> 立即满足
undefined
。¥Returns: <Promise> Immediately fulfilled with
undefined
.
从 node:test
模块导入的 describe()
函数。每次调用此函数都会创建一个子测试。调用顶层 describe
函数后,所有顶层测试和套件都将执行。
¥The describe()
function imported from the node:test
module. Each
invocation of this function results in the creation of a Subtest.
After invocation of top level describe
functions,
all top level tests and suites will execute.