test_runner: restore directory search for --test#64637
Open
bitpshr wants to merge 1 commit into
Open
Conversation
Passing a directory to `node --test` (e.g. `node --test tests`) matched the directory itself as a glob pattern and then tried to run it as a test file, failing with MODULE_NOT_FOUND. Before glob patterns were supported, a directory argument was searched for test files within it. Expand a pattern that resolves to a directory into a search for the default test files inside it. Despite the report framing this as Windows-only, it reproduces on every platform: it is a plain regression from when directory arguments stopped being searched. Fixes: nodejs#64555 Signed-off-by: Paul Bouchon <mail@bitpshr.net>
Collaborator
|
Review requested:
|
MoLow
approved these changes
Jul 21, 2026
Contributor
Author
|
Both CI failures look unrelated to this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #64555. Passing a directory to
node --test(likenode --test tests) matched the directory itself as a glob pattern and then tried to run it as a test file, failing withMODULE_NOT_FOUND.This expands a pattern that resolves to a directory into a search for the default test files inside it, restoring the pre-glob behavior. File paths, real glob patterns, and nonexistent arguments all pass through unchanged.
Note: This isn't Windows-specific despite the report; it reproduces on every platform (on macOS,
node@20searches the directory and passes whilenode@22andnode@24both fail).