Skip to content

Commit

Permalink
test(mongoose): repro #6890
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 2, 2018
1 parent e67ddc4 commit aff6596
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/index.test.js
Expand Up @@ -155,18 +155,18 @@ describe('mongoose module:', function() {
it('useCreateIndex option (gh-6880)', function() {
const mongoose = new Mongoose();

const M = mongoose.model('Test', new Schema({
name: { type: String, index: true }
}));

M.collection.ensureIndex = function() {
throw new Error('Fail');
};

mongoose.set('useCreateIndex', true);

return mongoose.connect(uri, options).
then(() => {
const M = mongoose.model('Test', new Schema({
name: { type: String, index: true }
}));

M.collection.ensureIndex = function() {
throw new Error('Fail');
};

return M.init();
}).
then(() => {
Expand Down

0 comments on commit aff6596

Please sign in to comment.