Skip to content

Commit

Permalink
test(model): repro #2037
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 4, 2017
1 parent 50aafb6 commit d0d2d5f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5718,6 +5718,18 @@ describe('Model', function() {
});
});

it('.create() with non-object (gh-2037)', function(done) {
var schema = new mongoose.Schema({ name: String });

var Model = db.model('gh2037', schema);

Model.create(1, function(error) {
assert.ok(error);
assert.equal(error.name, 'ObjectParameterError');
done();
});
});

it('bulkWrite casting updateMany, deleteOne, deleteMany (gh-3998)', function(done) {
var schema = new Schema({
str: String,
Expand Down

0 comments on commit d0d2d5f

Please sign in to comment.