Since my Mac has a case-insensitive filesystem case related typos will not be caught when running tests locally, however they fail on the build server which is running Linux.
For example: require('./mymodule')
will find ./myModule.js
when running on Lion, but not on Linux.
Since I'd like to have the tests fail locally as well in order to not break the build on the server, I'm looking for a way to make node.js require more strict in that it throws an error if it the filename is not exact (i.e. has a difference in casing).
Does anyone know of a way to accomplish this?
EDIT:
Since there seemed no good solution for this problem out there I created valiquire.
This tool validates all requires found in an entire nodejs project also ensuring that the casing is correct.
Since your hfs filesystem is not case sensitive, lookups for 'fileName' will match 'filename' at OS lib level, and therefore node.js will behave the same. So by definition there is no workaround.
But at the price of a reformating you can change your fs format to use hfs case sensitive.
http://www.coriolis-systems.com/iPartition.php is mentioned in this thread : http://superuser.com/questions/380330/mac-convert-from-case-sensitive-to-case-insensitive-file-system
Always use lowercase for filenames, then you won't have to about whether the filesystem supports it or not.
Reminds me of when people used to use spaces in urls.