Today I Learned
Two things!
-
You can run
sequelize db:migratewith an environment flag,--env=test, to run your migrations on a second database. I set up a customstart-testscript to run any pending migrations when I start the test server. This may prove to be time consuming once I start running tests frequently. Another option is to set up a custommigratescript to run migrations in development and test at the same time. -
I finally got a good explanation of the difference between “dependencies” and “devDependencies” in the
package.jsonfile. Regular dependencies are packages that the app needs when it’s actually running, whether on your local machine or a production server. Development dependencies are only needed in the development environment. For instance, anything related to testing is only necessary in development so it should be included in “devDependencies”. Other functions of a development dependency might be minifying and compiling assets before deployment.