Skip to content

node:test: Add suite() function to define suites #51430

@justinfagnani

Description

@justinfagnani

What is the problem this feature will solve?

Right now the node:test docs talk about suites, and include classes like SuiteContext, but the only way to define suites is with the describe() BDD-style function.

While the docs point out that "it is a shorthand for test()", there isn't yet a suite() function that describe() is a shorthand for.

Grouping tests with test() isn't the same, since that requires awaiting the subtests, which suites don't require.

What is the feature you are proposing to solve the problem?

Add a test() export that describe() is a shorthand for, like how it() is for test().

What alternatives have you considered?

import {test, describe as suite} from 'node:test';

However this doesn't address the issue that there's a missing correspondence between the typical describe/it and suite/test APIs, or that currently suites are a first-class concept, but only available via describe().

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.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