Fix: Allow running tests in nested test directories #21
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.
This PR fixes the issue where the test workflow was not running tests in nested test directories.
Problem
The existing test discovery mechanism was only looking for test files matching the pattern
test*.jsin the root of test directories. However, some test files were located in subdirectories within test directories (e.g.,test/es2015-arrow-function/index.js) and were not being found and executed during test runs.Solution
I updated the test discovery process to also find files in nested directories within test folders. The solution adds a new command that specifically looks for JavaScript files in subdirectories of test directories, which complements the existing command that finds test files in the root of test directories.
Testing Instructions
This should show files like
lib/node_modules/@stdlib/assert/is-arrow-function/test/es2015-arrow-function/index.js.And the test file I added as a demonstration:
This should show
lib/node_modules/@stdlib/_tools/benchmarks/browser-build/test/nested/test.js.Test Output
This ensures that all test files, even those in nested directories, are properly discovered and can be executed during test runs.