Skip to content

[node:test] Test shorthands return undefined #48557

Closed
@Semigradsky

Description

@Semigradsky

Version

v20.3.1

Platform

No response

Subsystem

No response

What steps will reproduce the bug?

> const { describe } = require('node:test')
undefined
> describe()
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 261,
  [Symbol(trigger_async_id_symbol)]: 6
}
> describe.skip()
undefined

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

By the docs:

test() returns a Promise that resolves once the test completes.

and

test.skip([name][, options][, fn])#
Shorthand for skipping a test, same as test([name], { skip: true }[, fn]).

So I expect that shorthands will have the same return type as test/describe/it functions.

What do you see instead?

Test shorthands return undefined

Additional information

The issue was discovered at DefinitelyTyped/DefinitelyTyped#65871

Metadata

Metadata

Assignees

No one assigned

    Labels

    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