diff --git a/test/basic-querying.test.js b/test/basic-querying.test.js index 5b48cdfa..e4a58f6b 100644 --- a/test/basic-querying.test.js +++ b/test/basic-querying.test.js @@ -2,7 +2,7 @@ var db, User, should = require('should'); describe('basic-querying', function() { - before(function() { + before(function(done) { db = getSchema(); User = db.define('User', { @@ -12,6 +12,8 @@ describe('basic-querying', function() { order: {type: Number, index: true} }); + db.automigrate(done); + }); @@ -193,7 +195,7 @@ describe('basic-querying', function() { User.exists(u.id, function(err, exists) { should.not.exist(err); should.exist(exists); - exists.should.be.true; + exists.should.be.ok; done(); }); }); @@ -203,7 +205,7 @@ describe('basic-querying', function() { User.destroyAll(function() { User.exists(42, function(err, exists) { should.not.exist(err); - exists.should.be.false; + exists.should.not.be.ok; done(); }); }); diff --git a/test/hooks.test.js b/test/hooks.test.js index 02a04738..235b1fcd 100644 --- a/test/hooks.test.js +++ b/test/hooks.test.js @@ -8,15 +8,17 @@ var j = require('../'), describe('hooks', function() { - before(function() { + before(function(done) { db = getSchema(); User = db.define('User', { - email: String, + email: {type: String, index: true}, name: String, password: String, state: String }); + + db.automigrate(done); }); describe('initialize', function() {