Skip to content

Commit

Permalink
test: clean up all remaining update() deprecation warnings #6880
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 23, 2018
1 parent 37a9d8a commit 3b7464c
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 125 deletions.
2 changes: 1 addition & 1 deletion test/document.test.js
Expand Up @@ -920,7 +920,7 @@ describe('document', function() {
});
});

describe('#update', function() {
describe.skip('#update', function() {
it('returns a Query', function(done) {
var mg = new mongoose.Mongoose;
var M = mg.model('doc#update', {s: String});
Expand Down
2 changes: 1 addition & 1 deletion test/model.findOneAndUpdate.test.js
Expand Up @@ -946,7 +946,7 @@ describe('model: findOneAndUpdate:', function() {
function(error, doc) {
assert.ifError(error);
assert.equal(doc.__v, 0);
Account.update({ name: 'test' }, {}, { upsert: true }, function(error) {
Account.replaceOne({ name: 'test' }, {}, { upsert: true }, function(error) {
assert.ifError(error);
Account.findOne({ name: 'test' }, function(error, doc) {
assert.ifError(error);
Expand Down
8 changes: 4 additions & 4 deletions test/model.populate.test.js
Expand Up @@ -1413,7 +1413,7 @@ describe('model: populate:', function() {
assert.ifError(err);

// add a non-schema property to the document.
BlogPost.collection.update(
BlogPost.collection.updateOne(
{_id: post._id}
, {$set: {'comments.0._idontexist': user2._id}}, function(err) {
assert.ifError(err);
Expand Down Expand Up @@ -2070,8 +2070,8 @@ describe('model: populate:', function() {
});

it('Update works with populated arrays (gh-602)', function(done) {
var BlogPost = db.model('RefBlogPost', posts),
User = db.model('RefUser', users);
var BlogPost = db.model('RefBlogPost', posts);
var User = db.model('RefUser', users);

User.create({name: 'aphex'}, {name: 'twin'}, function(err, u1, u2) {
assert.ifError(err);
Expand All @@ -2083,7 +2083,7 @@ describe('model: populate:', function() {
assert.ifError(err);

var update = {fans: [u1, u2]};
BlogPost.update({_id: post}, update, function(err) {
BlogPost.updateOne({_id: post}, update, function(err) {
assert.ifError(err);

// the original update doc should not be modified
Expand Down
2 changes: 1 addition & 1 deletion test/model.querying.test.js
Expand Up @@ -320,7 +320,7 @@ describe('model: querying:', function() {
});

return Model.create({}).
then(() => Model.update({}, {mixed: {}, name: 'abc'}, {minimize: true})).
then(() => Model.replaceOne({}, {mixed: {}, name: 'abc'}, {minimize: true})).
then(() => Model.collection.findOne()).
then(doc => {
assert.ok(doc.mixed == null);
Expand Down
2 changes: 1 addition & 1 deletion test/model.test.js
Expand Up @@ -3442,7 +3442,7 @@ describe('Model', function() {
});
});

it('update()', function(done) {
it.skip('update()', function(done) {
var col = 'BlogPost' + random();
var BlogPost = db.model(col, bpSchema);

Expand Down

0 comments on commit 3b7464c

Please sign in to comment.