I want to use this within my tests to allow me to create a test database and run my tests against the test database using all of the migrations in the script. However, I run into a problem in that migration() does not take a callback argument or return a promise enabling it to be used in a situation where I need to not run following code until the migration completes.
One thing I noticed is that my example above is not entirely correct. I need to modify argv via process.argv = ['test', 'test', 'up']; since the migrations.init assumes it is being run on the command line.
I want to use this within my tests to allow me to create a test database and run my tests against the test database using all of the migrations in the script. However, I run into a problem in that migration() does not take a callback argument or return a promise enabling it to be used in a situation where I need to not run following code until the migration completes.
The way I'd like to use this:
I'm actually using await/async syntax but a callback will allow me the functionality I need.