mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Sanity Tests
Babel Paths for Production Environment
In development, we transpile at server start. This allows us to work quickly while developing, but is not suitable for production. So, in production we transpile the server code before the app starts.
This system means that requiring any files from website/common/script in website/server/**/*.js must be done through the website/common/index.js module. In development, it'll pass through to the pre-transpiled files, but in production it'll point to the transpiled versions. If you try to require or import a file directly, it will error in production as the server doesn't know what to do with some es2015isms (such as the import statement).
This test just verifies that none of the files in the server code are calling the common files directly.