Skip to main content

function default.suite

Overload 1

#suite(
name?: string,
options?: TestOptions,
fn?: SuiteFn,
): Promise<void>

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

Parameters #

#name: string
optional

The name of the suite, which is displayed when reporting test results. Defaults to the name property of fn, or '<anonymous>' if fn does not have a name.

#options: TestOptions
optional

Configuration options for the suite. This supports the same options as test.

#fn: SuiteFn
optional

The suite function declaring nested tests and suites. The first argument to this function is a SuiteContext object.

Return Type #

Promise<void>

Immediately fulfilled with undefined.

Overload 2

#suite(
name?: string,
fn?: SuiteFn,
): Promise<void>

Parameters #

#name: string
optional
#fn: SuiteFn
optional

Return Type #

Promise<void>

Overload 3

#suite(
options?: TestOptions,
fn?: SuiteFn,
): Promise<void>

Parameters #

#options: TestOptions
optional
#fn: SuiteFn
optional

Return Type #

Promise<void>

Overload 4

#suite(fn?: SuiteFn): Promise<void>

Parameters #

#fn: SuiteFn
optional

Return Type #

Promise<void>

namespace default.suite

Functions #

f
default.suite.only

Shorthand for marking a suite as only. This is the same as calling suite with options.only set to true.

    f
    default.suite.skip

    Shorthand for skipping a suite. This is the same as calling suite with options.skip set to true.

      f
      default.suite.todo

      Shorthand for marking a suite as TODO. This is the same as calling suite with options.todo set to true.

        Did you find what you needed?

        Privacy policy