Skip to content

[node:test] Incorrect SuiteContext description #47882

@Semigradsky

Description

@Semigradsky

Affected URL(s)

https://nodejs.org/docs/latest-v20.x/api/test.html#describename-options-fn

Description of the problem

Docs said that callback function in describe:

declaring all subtests and subsuites. The first argument to this function is a SuiteContext object.

But in fact the first argument is array with SuiteContext:

import { describe } from 'node:test'

x.describe(function (suiteContext) {
    console.log(Array.isArray(suiteContext))     // true
    console.log(suiteContext[0])                 //  SuiteContext {}
})

Related to #45641 :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions