Skip to content

Commit

Permalink
remove co for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lineus committed May 14, 2018
1 parent 06cca17 commit 48f1fc3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var Schema = mongoose.Schema;
var assert = require('power-assert');
var random = require('../lib/utils').random;
var Query = require('../lib/query');
var co = require('co');

/**
* Test.
Expand Down Expand Up @@ -919,7 +918,7 @@ describe('Query', function() {
done();
});

it('doesn\'t wipe out $in (gh-6439)', function () {
it('doesn\'t wipe out $in (gh-6439)', function(done) {
var embeddedSchema = new Schema({
name: String
}, { _id: false });
Expand All @@ -939,8 +938,8 @@ describe('Query', function() {
]
});

return co(function* () {
yield kitty.save();
kitty.save(function(err) {
assert.ifError(err);
var cond = { _id: kitty._id };
var update = {
$pull: {
Expand All @@ -952,9 +951,14 @@ describe('Query', function() {
}
}
};
yield Cat.update(cond, update);
let found = yield Cat.findOne(cond);
assert.strictEqual(found.props[0].name, 'abc');
Cat.update(cond, update, function(err) {
assert.ifError(err);
Cat.findOne(cond, function(err, found) {
assert.ifError(err);
assert.strictEqual(found.props[0].name, 'abc');
done();
});
});
});
});

Expand Down

0 comments on commit 48f1fc3

Please sign in to comment.