Skip to content

test: only collect .js files as tests - #360

Merged
dimdenGD merged 1 commit into
dimdenGD:mainfrom
nigrosimone:fix-test-collection-nonjs
Jul 31, 2026
Merged

test: only collect .js files as tests#360
dimdenGD merged 1 commit into
dimdenGD:mainfrom
nigrosimone:fix-test-collection-nonjs

Conversation

@nigrosimone

Copy link
Copy Markdown
Contributor

The runner reads every entry of a category folder and passes it to readFileSync, so anything in there that is not a file takes the whole category down with EISDIR: illegal operation on a directory, read.

That is easy to end up with. tests/middlewares/express-fileupload-temp.js writes to ./tmp, which resolves against the working directory rather than the test file, so running that test directly from its own folder leaves tests/tests/middlewares/tmp/ behind. It is covered by the tmp/ line in .gitignore, so it never shows up in git status and stays there.

I hit it with a directory left over from February, which made the whole middlewares category fail before a single test in it ran.

Filtering to .js entries is enough.

Some tests write scratch directories next to themselves. express-fileupload-temp
uses './tmp', which resolves against the working directory, so running it directly
from its own folder leaves a tmp directory behind that is gitignored and therefore
sticks around.

The runner reads every entry of a category folder as a test file, so a leftover
directory makes readFileSync throw EISDIR and takes the whole category with it.
Filter to .js entries.
@dimdenGD
dimdenGD merged commit f24e0f5 into dimdenGD:main Jul 31, 2026
4 checks passed
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