matthiaaas / express-file-routing

Flexible file-based routing for Express (like Next.js + additional features)
https://www.npmjs.com/package/express-file-routing
MIT License
85 stars 13 forks source link

Is it possible to ignore nested folders to support actions like testing #39

Open jackcrane opened 4 hours ago

jackcrane commented 4 hours ago

File routing tries to pull in all files in the workspace, including those in tests or test folders, and ending with .test.js. This will cause errors if testing libraries are pulled in during runtime code. It would be nice to be able to ignore all .test.js files

matthiaaas commented 4 hours ago

Hi @jackcrane, thank you for raising an issue. Only source files inside the specified routes directory are being used for route generation.

You can either move the tests folder outside of the routes directory or prefix them with an underscore to exclude them.