Permalink
Browse files

tweak test timing

  • Loading branch information...
1 parent f7d2145 commit 5181a2a5b95baaf55e9bcf916b7eb4bcbf4c76a7 @aheckmann aheckmann committed Jul 17, 2012
Showing with 21 additions and 20 deletions.
  1. +1 −0 test/model.field.selection.test.js
  2. +20 −20 test/model.test.js
@@ -168,6 +168,7 @@ describe('model field selection', function(){
BlogPostB.findById(id, 'def comments', function (err, found) {
db.close();
assert.ifError(err);
+ assert.ok(found);
assert.equal(found._id.toString(), id);
assert.strictEqual(undefined, found.title);
assert.strictEqual('kandinsky', found.def);
View
@@ -2994,33 +2994,33 @@ describe('model', function(){
Human.on('index', function (err) {
assert.ifError(err);
- });
-
- var me = new Human({
- name : 'Guillermo Rauch'
- , email : 'rauchg@gmail.com'
- });
-
- me.save(function (err) {
- assert.ifError(err);
+ var me = new Human({
+ name : 'Guillermo Rauch'
+ , email : 'rauchg@gmail.com'
+ });
- Human.findById(me._id, function (err, doc){
+ me.save(function (err) {
assert.ifError(err);
- assert.equal(doc.email,'rauchg@gmail.com');
- var copycat = new Human({
- name : 'Lionel Messi'
- , email : 'rauchg@gmail.com'
- });
+ Human.findById(me._id, function (err, doc){
+ assert.ifError(err);
+ assert.equal(doc.email,'rauchg@gmail.com');
- copycat.save(function (err) {
- db.close();
- assert.ok(/duplicate/.test(err.message));
- assert.ok(err instanceof Error);
- done();
+ var copycat = new Human({
+ name : 'Lionel Messi'
+ , email : 'rauchg@gmail.com'
+ });
+
+ copycat.save(function (err) {
+ db.close();
+ assert.ok(/duplicate/.test(err.message));
+ assert.ok(err instanceof Error);
+ done();
+ });
});
});
});
+
});
it('can be disabled', function(done){

0 comments on commit 5181a2a

Please sign in to comment.