Skip to content

Commit

Permalink
chore(comments): add some notes to the api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wzrdtales committed Jul 27, 2016
1 parent 03226f3 commit 4949f2e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions new/integration/api_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,32 @@ lab.experiment('api', function() {
function(done, onCleanup) {

var process_exit = process.exit,
argv = process.argv;

var called = false,
argv = process.argv,
called = false,
config = { cwd: __dirname };

// register cleanup method and start preparing the test
onCleanup(teardown);

createMigration(function() {

var dbmigrate = DBMigrate.getInstance(true, config);

dbmigrate.setConfigParam('force-exit', true);
dbmigrate.silence(true);

/**
* We have set force-exit above, this should end up in db-migrate
* executing process.exit on the final callback.
* Process.exit has been overwritten and will finally call validate.
*
* The test validation takes place in validate()
*/
dbmigrate.up();
});

/**
* Final validation after process.exit should have been called.
*/
function validate() {

Code.expect(called).to.equal(true);
Expand Down

0 comments on commit 4949f2e

Please sign in to comment.