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.only does not work without it being wrapped in describe.only #51882

Closed
mohsen1 opened this issue Feb 26, 2024 · 4 comments
Closed
Labels
test_runner Issues and PRs related to the test runner subsystem.

Comments

@mohsen1
Copy link

mohsen1 commented Feb 26, 2024

Version

20

Platform

Mac

Subsystem

No response

What steps will reproduce the bug?

// file: example.test.js
const {test, describe} = require('node:test');

describe('something', () => {
  test.only('example', async () => {
    // some async test
   });
});
node --test --test-only

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

No response

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

I would expect Node test runner to be smart to pick up the test.only without expecting me to mark the wrapper describe block with only also. There are cases that tests are a few describe blocks deep. It is really uncomfortable to update all of the parents with only

What do you see instead?

I get

﹣ something (0.351ms) # 'only' option not set

Additional information

No response

@targos
Copy link
Member

targos commented Feb 27, 2024

@nodejs/test_runner

@targos targos added the test_runner Issues and PRs related to the test runner subsystem. label Feb 27, 2024
@MoLow
Copy link
Member

MoLow commented Feb 27, 2024

Duplicate of #47945

@MoLow MoLow marked this as a duplicate of #47945 Feb 27, 2024
@MoLow MoLow closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
@drmaquino
Copy link

drmaquino commented Apr 1, 2024

this should be at least added to the documentation. i had the same issue.

@cjihrig
Copy link
Contributor

cjihrig commented Apr 1, 2024

That behavior will be going away soon: #52296

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

No branches or pull requests

5 participants