Skip to content

Conversation

@idavidrein
Copy link

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*.js in 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

  1. Clone the repository:
git clone https://github.com/human-uplift/stdlib.git
cd stdlib
  1. Checkout this PR branch:
git checkout 417e65361234ec46382f58cc303a544f5bbcbf9e_2025-04-17_22-53-13
  1. Run the list-tests command to see tests in nested directories:
make list-tests | grep "es2015-arrow-function"

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:

make list-tests | grep "browser-build/test/nested"

This should show lib/node_modules/@stdlib/_tools/benchmarks/browser-build/test/nested/test.js.

Test Output

$ make list-tests | grep "es2015-arrow-function"
/workspace/stdlib/lib/node_modules/@stdlib/assert/is-arrow-function/test/es2015-arrow-function/index.js

$ make list-tests | grep "browser-build/test/nested"
/workspace/stdlib/lib/node_modules/@stdlib/_tools/benchmarks/browser-build/test/nested/test.js

This ensures that all test files, even those in nested directories, are properly discovered and can be executed during test runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants