Skip to content

test_runner: expand directory arguments to find test files - #64824

Open
aalhadxx wants to merge 1 commit into
nodejs:mainfrom
aalhadxx:fix-test-runner-directory-args
Open

test_runner: expand directory arguments to find test files#64824
aalhadxx wants to merge 1 commit into
nodejs:mainfrom
aalhadxx:fix-test-runner-directory-args

Conversation

@aalhadxx

Copy link
Copy Markdown

When a directory is passed as an argument to node --test, the test runner treats it as a file pattern. Node.js internal Glob matches the directory itself, causing MODULE_NOT_FOUND when the runner tries to import the directory as a module.

This restores the pre-v21 behavior by detecting directory arguments and expanding them to search for default test file patterns within them.

Fixes: #64555

When a directory is passed as an argument to node --test, the test
runner treats it as a file pattern. Node.js internal Glob matches the
directory itself, causing MODULE_NOT_FOUND when the runner tries to
import the directory as a module.

This restores the pre-v21 behavior by detecting directory arguments and
expanding them to search for default test file patterns within them.

Fixes: nodejs#64555
@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 29, 2026
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)

2 participants