@@ -247,7 +247,10 @@ describe('crud - insert', function () {
247247 test . equal ( date . toString ( ) , doc . date . toString ( ) ) ;
248248 test . equal ( date . getTime ( ) , doc . date . getTime ( ) ) ;
249249 test . equal ( motherOfAllDocuments . oid . toHexString ( ) , doc . oid . toHexString ( ) ) ;
250- test . equal ( motherOfAllDocuments . binary . value ( ) , doc . binary . value ( ) ) ;
250+ test . equal (
251+ motherOfAllDocuments . binary . value ( ) . toString ( 'hex' ) ,
252+ doc . binary . value ( ) . toString ( 'hex' )
253+ ) ;
251254
252255 test . equal ( motherOfAllDocuments . int , doc . int ) ;
253256 test . equal ( motherOfAllDocuments . long , doc . long ) ;
@@ -398,7 +401,10 @@ describe('crud - insert', function () {
398401 test . equal ( date . toString ( ) , doc . date . toString ( ) ) ;
399402 test . equal ( date . getTime ( ) , doc . date . getTime ( ) ) ;
400403 test . equal ( motherOfAllDocuments . oid . toHexString ( ) , doc . oid . toHexString ( ) ) ;
401- test . equal ( motherOfAllDocuments . binary . value ( ) , doc . binary . value ( ) ) ;
404+ test . equal (
405+ motherOfAllDocuments . binary . value ( ) . toString ( 'hex' ) ,
406+ doc . binary . value ( ) . toString ( 'hex' )
407+ ) ;
402408
403409 test . equal ( motherOfAllDocuments . int , doc . int ) ;
404410 test . equal ( motherOfAllDocuments . long , doc . long ) ;
@@ -1482,28 +1488,28 @@ describe('crud - insert', function () {
14821488 // in this case we are setting that node needs to be higher than 0.10.X to run
14831489 metadata : {
14841490 requires : {
1485- topology : [ 'single' , 'replicaset' , 'ssl' , 'heap' , 'wiredtiger' ] ,
14861491 mongodb : '>=2.8.0'
14871492 }
14881493 } ,
14891494
14901495 test : function ( done ) {
14911496 var configuration = this . configuration ;
14921497 var client = configuration . newClient ( configuration . writeConcernMax ( ) , { maxPoolSize : 1 } ) ;
1498+
1499+ var document = {
1500+ string : 'abcdefghijkl' ,
1501+ objid : new ObjectId ( Buffer . alloc ( 12 , 1 ) ) ,
1502+ double : new Double ( 1 ) ,
1503+ binary : new Binary ( Buffer . from ( 'hello world' ) ) ,
1504+ minkey : new MinKey ( ) ,
1505+ maxkey : new MaxKey ( ) ,
1506+ code : new Code ( 'function () {}' , { a : 55 } )
1507+ } ;
1508+
14931509 client . connect ( function ( err , client ) {
14941510 var db = client . db ( configuration . db ) ;
14951511 var collection = db . collection ( 'bson_types_insert_1' ) ;
14961512
1497- var document = {
1498- string : 'abcdefghijkl' ,
1499- objid : new ObjectId ( 'abcdefghijkl' ) ,
1500- double : new Double ( 1 ) ,
1501- binary : new Binary ( Buffer . from ( 'hello world' ) ) ,
1502- minkey : new MinKey ( ) ,
1503- maxkey : new MaxKey ( ) ,
1504- code : new Code ( 'function () {}' , { a : 55 } )
1505- } ;
1506-
15071513 collection . insert ( document , configuration . writeConcernMax ( ) , function ( err , result ) {
15081514 expect ( err ) . to . not . exist ;
15091515 test . ok ( result ) ;
@@ -1512,9 +1518,9 @@ describe('crud - insert', function () {
15121518 expect ( err ) . to . not . exist ;
15131519 test . equal ( 'abcdefghijkl' , doc . string . toString ( ) ) ;
15141520
1515- collection . findOne ( { objid : new ObjectId ( 'abcdefghijkl' ) } , function ( err , doc ) {
1521+ collection . findOne ( { objid : new ObjectId ( Buffer . alloc ( 12 , 1 ) ) } , function ( err , doc ) {
15161522 expect ( err ) . to . not . exist ;
1517- test . equal ( '6162636465666768696a6b6c' , doc . objid . toString ( ) ) ;
1523+ test . equal ( '01' . repeat ( 12 ) , doc . objid . toString ( ) ) ;
15181524
15191525 collection . findOne ( { double : new Double ( 1 ) } , function ( err , doc ) {
15201526 expect ( err ) . to . not . exist ;
0 commit comments