-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Test runner cannot find tests in multiple levels when using ** in tha path #50287
Comments
Have you tried quoting the path on the command line?
Otherwise your shell may evaluate the glob before Node.js has any chance of processing it. |
Node 20.8.1:
Node 21: |
Oh, I overlooked the Node.js version in your issue. Glob support was only added to v21. Good to hear your problem is solved; I think this can be closed then? |
Clear for me. But then we have a way it works for Node 20 And a way it works for Node 21 But the first command doesn't work on Node 21 and the second doesn't work on Node 20. |
Unfortunately this was a breaking change so it won't work the same in node 21 and node 20. |
* Convert tests to Node test framework * Make the tests run (despite nodejs/node#50287) * Remove Jest * Drop old Node 14
Finding test files with `**` glob syntax was not working. That feature required node 21: nodejs/node#50287 (comment)
Version
20
Platform
Linux tux 6.5.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 7 01:35:40 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
node --test src/**/*.test.js
Only finds tests in all folders in that level, e.g.
src/a/a.test.js
andsrc/b/b.test.js
It cannot find a level deeper, like
src/a/b/c.js
It works with
node --test src/
in Node 20But in Node 21 I receive an error, because it thinks that it can test the file src, but src is a folder.
How often does it reproduce? Is there a required condition?
Tests in multiple folder levels and usage of /**/ in the cli
What is the expected behavior? Why is that the expected behavior?
That /**/ also find tests in multiple levels.
What do you see instead?
That /**/ just check for test files in a single level
Additional information
No response
The text was updated successfully, but these errors were encountered: