@@ -758,30 +758,24 @@ exports['should correctly pass indexOptionDefault through to createIndexCommand'
758
758
test : function ( configuration , test ) {
759
759
var db = configuration . newDbInstance ( configuration . writeConcernMax ( ) , { poolSize :1 } ) ;
760
760
db . open ( function ( err , db ) {
761
- var listener = require ( '../..' ) . instrument ( function ( err , instrumentations ) {
762
- callbackTriggered = true ;
763
- } ) ;
761
+ var started = [ ] , succeeded = [ ] ;
764
762
763
+ var listener = require ( '../..' ) . instrument ( function ( err , instrumentations ) { } ) ;
765
764
listener . on ( 'started' , function ( event ) {
766
- if ( event . commandName == 'insert ' )
765
+ if ( event . commandName == 'createIndexes ' )
767
766
started . push ( event ) ;
768
767
} ) ;
769
768
770
769
listener . on ( 'succeeded' , function ( event ) {
771
- if ( event . commandName == 'insert ' )
770
+ if ( event . commandName == 'createIndexes ' )
772
771
succeeded . push ( event ) ;
773
772
} ) ;
774
773
775
-
776
774
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
-
782
775
test . equal ( null , err ) ;
783
- listener . uninstrument ( ) ;
776
+ test . ok ( true , started [ 0 ] . command . indexes [ 0 ] . indexOptionDefaults ) ;
784
777
778
+ listener . uninstrument ( ) ;
785
779
db . close ( ) ;
786
780
test . done ( ) ;
787
781
} ) ;
0 commit comments