diff --git a/app/tests/article.server.model.test.js b/app/tests/article.server.model.test.js index e3dd60c889..9ced1d467a 100644 --- a/app/tests/article.server.model.test.js +++ b/app/tests/article.server.model.test.js @@ -57,8 +57,8 @@ describe('Article Model Unit Tests:', function() { }); afterEach(function(done) { - Article.remove().exec(); - User.remove().exec(); - done(); + Article.remove().exec(function() { + User.remove().exec(done); + }); }); -}); \ No newline at end of file +}); diff --git a/app/tests/article.server.routes.test.js b/app/tests/article.server.routes.test.js index 34255f5e18..55716a1496 100644 --- a/app/tests/article.server.routes.test.js +++ b/app/tests/article.server.routes.test.js @@ -273,8 +273,8 @@ describe('Article CRUD tests', function() { }); afterEach(function(done) { - User.remove().exec(); - Article.remove().exec(); - done(); + User.remove().exec(function() { + Article.remove().exec(done); + }); }); -}); \ No newline at end of file +}); diff --git a/app/tests/user.server.model.test.js b/app/tests/user.server.model.test.js index 7369d41464..e43848764d 100644 --- a/app/tests/user.server.model.test.js +++ b/app/tests/user.server.model.test.js @@ -52,10 +52,11 @@ describe('User Model Unit Tests:', function() { }); it('should fail to save an existing user again', function(done) { - user.save(); - return user2.save(function(err) { - should.exist(err); - done(); + user.save(function() { + user2.save(function(err) { + should.exist(err); + done(); + }); }); }); @@ -69,7 +70,6 @@ describe('User Model Unit Tests:', function() { }); after(function(done) { - User.remove().exec(); - done(); + User.remove().exec(done); }); -}); \ No newline at end of file +});