diff --git a/test/model.indexes.test.js b/test/model.indexes.test.js index 113980002cd..290fd59d8fe 100644 --- a/test/model.indexes.test.js +++ b/test/model.indexes.test.js @@ -104,12 +104,15 @@ describe('model', function() { }); }); - it('of embedded documents unless excludeIndexes (gh-5575)', function(done) { - const BlogPost = new Schema({ - _id: {type: ObjectId}, - title: {type: String, index: true}, + it('of embedded documents unless excludeIndexes (gh-5575) (gh-8343)', function(done) { + const BlogPost = Schema({ + _id: { type: ObjectId }, + title: { type: String, index: true }, desc: String }); + const otherSchema = Schema({ + name: { type: String, index: true } + }, { excludeIndexes: true }) const User = new Schema({ name: {type: String, index: true}, @@ -121,7 +124,8 @@ describe('model', function() { blogpost: { type: BlogPost, excludeIndexes: true - } + }, + otherArr: [otherSchema] }); const UserModel = db.model('gh5575', User);