Skip to content

Commit

Permalink
test(model): repro Automattic#8363
Browse files Browse the repository at this point in the history
  • Loading branch information
Fonger committed Nov 20, 2019
1 parent 33412d9 commit c6f3dd2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/model.test.js
Expand Up @@ -4909,6 +4909,18 @@ describe('Model', function() {
});
});

it('insertMany() with non object array error can be catched (gh-8363)', function(done) {
const schema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
url: { type: String }
});
const Image = db.model('gh8363', schema);
Image.insertMany(['a', 'b', 'c']).catch((error) => {
assert.equal(error.name, 'ObjectParameterError');
done();
});
});

it('insertMany() return docs with empty modifiedPaths (gh-7852)', function() {
const schema = new Schema({
name: { type: String }
Expand Down

0 comments on commit c6f3dd2

Please sign in to comment.