test_runner: restore directory search for --test - #64637
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>
|
Review requested:
|
|
Both CI failures look unrelated to this change. |
|
Just keeping this on the radar. It's been approved for a couple of weeks now, and it's a small test_runner fix (restoring directory arguments to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64637 +/- ##
=======================================
Coverage 90.13% 90.13%
=======================================
Files 741 741
Lines 242076 242095 +19
Branches 45550 45552 +2
=======================================
+ Hits 218199 218219 +20
+ Misses 15391 15386 -5
- Partials 8486 8490 +4
🚀 New features to boost your workflow:
|
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).