Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node:test] Test shorthands return undefined #48557

Closed
Semigradsky opened this issue Jun 26, 2023 · 0 comments · Fixed by #48555
Closed

[node:test] Test shorthands return undefined #48557

Semigradsky opened this issue Jun 26, 2023 · 0 comments · Fixed by #48555
Labels
test_runner Issues and PRs related to the test runner subsystem.

Comments

@Semigradsky
Copy link
Contributor

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

@MoLow MoLow added the test_runner Issues and PRs related to the test runner subsystem. label Jun 26, 2023
shockerqt added a commit to shockerqt/node that referenced this issue Jun 27, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: nodejs#48557
nodejs-github-bot pushed a commit that referenced this issue Jul 3, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
RafaelGSS pushed a commit that referenced this issue Jul 3, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Ceres6 pushed a commit to Ceres6/node that referenced this issue Aug 14, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: nodejs#48557
PR-URL: nodejs#48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Ceres6 pushed a commit to Ceres6/node that referenced this issue Aug 14, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: nodejs#48557
PR-URL: nodejs#48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
ruyadorno pushed a commit that referenced this issue Sep 11, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
ruyadorno pushed a commit that referenced this issue Sep 13, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
ruyadorno pushed a commit that referenced this issue Sep 17, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants