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

Commit

Permalink
Wait for async saving and removing
Browse files Browse the repository at this point in the history
  • Loading branch information
vepasto committed Feb 23, 2015
1 parent 6e1085e commit 1897ef9
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
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
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
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 1897ef9

Please sign in to comment.