-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 22 ignores --test-name-pattern
#53589
Comments
I'm not seeing the issue. If you want to only run tests with a pattern, use If I'm missing something, let me know |
Even with |
The test isn't running, but I do see it's marked as You can tell it's not running: import { equal } from 'node:assert'
import { test } from 'node:test'
test('one', () => {
console.log("TEST")
equal(1, 1)
})
|
Yes, the problem is with output |
@cjihrig You worked on FWIW |
Oh, I see what is going on here. There is no bug. There is one test file being run, which is passing. When there are no tests executed in a file, the test runner reports that the file ran (pass/fail is determined by that file's exit code). |
Weird. Why don’t we count inactive |
This behavior was changed in v22 at the request of users. When filtering is used ( I would not be opposed to adding another line in the summary for filtered test count (and test file count for that matter), but it's probably not something I'll work on personally any time soon. |
I also wouldn't be opposed to it (not that that really matters), but that (IMO) should be discussed in a seperate issue As for this issue, I'm closing this as it appears to be resolved (working as intended). If you (@ai) would like to work on a change that modifies the code, feel free to open a PR, and if you want a new feature, feel free to open an issue describing it. If someone disagrees, please re-open the issue |
Version
v22.3.0
Platform
Linux savoia 6.9.5-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jun 16 15:47:09 UTC 2024 x86_64 GNU/Linux
Subsystem
test
What steps will reproduce the bug?
one.test.js
:$ node --test-name-pattern="wehadnosuchtextintest" --test one.test.js
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
To have
skipped 1
in the output andone
test should not be runWhat do you see instead?
Additional information
Here is a simple project where I found that issue
ai/better-node-test#3
The text was updated successfully, but these errors were encountered: