Skip to content

[node:test] Incorrect SuiteContext description #45641

Description

@Semigradsky

Affected URL(s)

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

Description of the problem

Docs said that tha callback function in describe:

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

But in fact SuiteContext is not the first argument. SuiteContext is this context:

import { describe } from 'node:test'

describe(function(foo) {
    console.log('First argument: ', foo)
    console.log('this: ', this)
})

> First argument:  []
> this:  { signal: AbortSignal { aborted: false }, name: '<anonymous>' }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.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