Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #421 from vepasto/0.4.0
Browse files Browse the repository at this point in the history
Wait for async savings and removing in mocha tests
  • Loading branch information
ilanbiala committed Feb 23, 2015
2 parents d1b4bde + 1897ef9 commit 709c27f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions modules/articles/tests/server/article.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
6 changes: 3 additions & 3 deletions modules/articles/tests/server/article.server.routes.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ describe('Article CRUD tests', function() {
});

afterEach(function(done) {
User.remove().exec();
Article.remove().exec();
done();
User.remove().exec(function() {
Article.remove().exec(done);
});
});
});
12 changes: 6 additions & 6 deletions modules/users/tests/server/user.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});

Expand All @@ -69,7 +70,6 @@ describe('User Model Unit Tests:', function() {
});

after(function(done) {
User.remove().exec();
done();
User.remove().exec(done);
});
});

0 comments on commit 709c27f

Please sign in to comment.