describe([name][, options][, fn])
name<string> 测试套件的名称,在报告测试结果时显示。默认值: 如果fn有名称,则为fn的name属性;如果fn没有名称,则为'<anonymous>'。options<Object> 套件的配置选项。支持与test([名称][, options][, fn])相同的选项。fn<Function> | <AsyncFunction> 套件下的函数,用于声明所有子测试和子套件。该函数的第一个参数是一个SuiteContext对象。默认值: 一个空操作函数。- 返回:
undefined。
从 node:test 模块导入的 describe() 函数。每次调用此函数都会创建一个子测试以及 TAP 输出中的一个测试点。在调用顶层 describe 函数后,所有顶层测试和测试套件将会执行。
【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.】