Skip to content

test_runner: support directory arguments to --test#64659

Open
dhruvvv0913 wants to merge 1 commit into
nodejs:mainfrom
dhruvvv0913:test-runner-dir-args
Open

test_runner: support directory arguments to --test#64659
dhruvvv0913 wants to merge 1 commit into
nodejs:mainfrom
dhruvvv0913:test-runner-dir-args

Conversation

@dhruvvv0913

Copy link
Copy Markdown

Since test file discovery moved to the internal glob, a directory passed to --test (for example node --test test/) matched the directory itself and was then spawned as a test file, failing with MODULE_NOT_FOUND. Directory arguments were documented and supported before that change.

Expand a user-supplied pattern that contains no glob magic and resolves to an existing directory into a recursive search for the default test file patterns within it, restoring the previous behavior. Glob patterns and explicit file arguments are unchanged, and node_modules remains excluded.

Fixes: #64555

Since test file discovery moved to the internal glob, a directory
passed to `--test` (for example `node --test test/`) matched the
directory itself and was then spawned as a test file, failing with
MODULE_NOT_FOUND. Directory arguments were documented and supported
before that change.

Expand a user-supplied pattern that contains no glob magic and resolves
to an existing directory into a recursive search for the default test
file patterns within it, restoring the previous behavior. Glob patterns
and explicit file arguments are unchanged, and `node_modules` remains
excluded.

Fixes: nodejs#64555
Signed-off-by: dhruv <dhruvtripathi2k5@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 21, 2026
@dhruvvv0913
dhruvvv0913 marked this pull request as ready for review July 21, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_runner: directory arguments to --test fail with MODULE_NOT_FOUND on Windows (regression since v20)

3 participants