@@ -101,9 +101,10 @@ describe('MongoDB Operations', function () {
101101 result . should . be . Array
102102 result . length . should . eql ( 1 )
103103 should . exist ( result [ 0 ] . fieldName )
104- should . exist ( result [ 0 ] . _id ) ;
105-
106- ( typeof result [ 0 ] . _id ) . should . eql ( 'object' )
104+ should . exist ( result [ 0 ] . _id )
105+ result [ 0 ] . _id . should . be . String
106+ result [ 0 ] . _id . length . should . eql ( 24 )
107+ should . equal ( Object . keys ( result [ 0 ] . _id ) . length , 24 )
107108 done ( )
108109 } ) . catch ( ( err ) => {
109110 done ( err )
@@ -130,10 +131,16 @@ describe('MongoDB Operations', function () {
130131 should . exist ( result [ 0 ] . fieldName )
131132 should . exist ( result [ 0 ] . _id ) ;
132133
133- ( typeof result [ 0 ] . _id ) . should . eql ( 'object' )
134-
135134 result [ 0 ] . fieldName . should . eql ( 'foo' )
135+ result [ 0 ] . _id . length . should . eql ( 24 )
136+ result [ 0 ] . _id . should . be . String
137+ should . equal ( Object . keys ( result [ 0 ] . _id ) . length , 24 )
138+
136139 result [ 1 ] . fieldName . should . eql ( 'foo_1' )
140+ result [ 1 ] . _id . length . should . eql ( 24 )
141+ result [ 1 ] . _id . should . be . String
142+ should . equal ( Object . keys ( result [ 1 ] . _id ) . length , 24 )
143+
137144 done ( )
138145 } ) . catch ( ( err ) => {
139146 done ( err )
@@ -175,6 +182,8 @@ describe('MongoDB Operations', function () {
175182 result . results . should . be . Array
176183 result . results . length . should . eql ( 1 )
177184 result . results [ 0 ] . _id . should . eql ( inserted . _id )
185+ result . results [ 0 ] . _id . length . should . eql ( 24 )
186+ Object . keys ( result . results [ 0 ] . _id ) . length . should . eql ( 24 )
178187 done ( )
179188 } )
180189 } ) . catch ( ( err ) => {
@@ -195,6 +204,8 @@ describe('MongoDB Operations', function () {
195204 result . results . should . be . Array
196205 result . results . length . should . eql ( 1 )
197206 result . results [ 0 ] . _id . should . eql ( inserted . _id )
207+ result . results [ 0 ] . _id . length . should . eql ( 24 )
208+ Object . keys ( result . results [ 0 ] . _id ) . length . should . eql ( 24 )
198209 done ( )
199210 } )
200211 } ) . catch ( ( err ) => {
0 commit comments