Skip to content

Commit a7b01c7

Browse files
committed
Added test for DRIVERS-253
1 parent d23aeaf commit a7b01c7

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

test/functional/index_tests.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -758,30 +758,24 @@ exports['should correctly pass indexOptionDefault through to createIndexCommand'
758758
test: function(configuration, test) {
759759
var db = configuration.newDbInstance(configuration.writeConcernMax(), {poolSize:1});
760760
db.open(function(err, db) {
761-
var listener = require('../..').instrument(function(err, instrumentations) {
762-
callbackTriggered = true;
763-
});
761+
var started = [], succeeded = [];
764762

763+
var listener = require('../..').instrument(function(err, instrumentations) {});
765764
listener.on('started', function(event) {
766-
if(event.commandName == 'insert')
765+
if(event.commandName == 'createIndexes')
767766
started.push(event);
768767
});
769768

770769
listener.on('succeeded', function(event) {
771-
if(event.commandName == 'insert')
770+
if(event.commandName == 'createIndexes')
772771
succeeded.push(event);
773772
});
774773

775-
776774
db.collection('indexOptionDefault').createIndex({a:1}, { indexOptionDefaults: true }, function(err, r) {
777-
console.log("-------------------------------------------------------------")
778-
console.dir(err)
779-
console.dir(r)
780-
console.dir(started)
781-
782775
test.equal(null, err);
783-
listener.uninstrument();
776+
test.ok(true, started[0].command.indexes[0].indexOptionDefaults);
784777

778+
listener.uninstrument();
785779
db.close();
786780
test.done();
787781
});

0 commit comments

Comments
 (0)