Skip to content

Commit

Permalink
test(schema): repro #9390
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 7, 2020
1 parent 1729a8b commit 1b19af2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/schema.test.js
Expand Up @@ -739,11 +739,17 @@ describe('schema', function() {
}, { _id: true });
assert.ok(schema.path('_id') instanceof Schema.ObjectId);

schema.set('_id', false);
assert.ok(schema.path('_id') == null);

schema = new Schema({
name: String
}, { _id: false });
assert.equal(schema.path('_id'), undefined);

schema.set('_id', true);
assert.ok(schema.path('_id') instanceof Schema.ObjectId);

// old options
schema = new Schema({
name: String
Expand Down

0 comments on commit 1b19af2

Please sign in to comment.