@@ -86,8 +86,8 @@ describe('Extended JSON', function () {
8686 expect ( json ) . to . equal ( EJSON . stringify ( doc , null , 0 , { relaxed : false } ) ) ;
8787 } ) ;
8888
89- it ( 'should correctly deserialize using the default relaxed mode' , function ( ) {
90- // Deserialize the document using non strict mode
89+ it ( 'should correctly deserialize using the default relaxed mode (relaxed=true) ' , function ( ) {
90+ // Deserialize the document using relaxed=true mode
9191 let doc1 = EJSON . parse ( EJSON . stringify ( doc , null , 0 ) ) ;
9292
9393 // Validate the values
@@ -96,7 +96,7 @@ describe('Extended JSON', function () {
9696 expect ( 0x19000000000000 ) . to . equal ( doc1 . longNumberIntFit ) ;
9797 expect ( 19007199250000000 ) . to . equal ( doc1 . doubleNumberIntFit ) ;
9898
99- // Deserialize the document using strict mode
99+ // Deserialize the document using relaxed=false
100100 doc1 = EJSON . parse ( EJSON . stringify ( doc , null , 0 ) , { relaxed : false } ) ;
101101
102102 // Validate the values
@@ -117,9 +117,10 @@ describe('Extended JSON', function () {
117117 const text = EJSON . stringify ( doc1 , null , 0 , { relaxed : false } ) ;
118118 expect ( text ) . to . equal ( '{"int32":{"$numberInt":"10"}}' ) ;
119119
120- // Deserialize the json in strict and non strict mode
120+ // Deserialize the json in relaxed=false mode
121121 let doc2 = EJSON . parse ( text , { relaxed : false } ) ;
122122 expect ( doc2 . int32 . _bsontype ) . to . equal ( 'Int32' ) ;
123+ // Deserialize the json in relaxed=true mode
123124 doc2 = EJSON . parse ( text ) ;
124125 expect ( doc2 . int32 ) . to . equal ( 10 ) ;
125126 } ) ;
@@ -589,7 +590,7 @@ Converting circular structure to EJSON:
589590 } ) ;
590591
591592 context ( 'when serializing date' , function ( ) {
592- context ( 'when using strict mode' , function ( ) {
593+ context ( 'when using relaxed=false mode' , function ( ) {
593594 it ( 'stringifies $date with with ISO-8601 string' , function ( ) {
594595 const date = new Date ( 1452124800000 ) ;
595596 const doc = { field : date } ;
@@ -667,7 +668,7 @@ Converting circular structure to EJSON:
667668 } ) ;
668669
669670 context ( 'when deserializing date' , function ( ) {
670- context ( 'when using strict mode' , function ( ) {
671+ context ( 'when using relaxed=false mode' , function ( ) {
671672 it ( 'parses $date with with ISO-8601 string' , function ( ) {
672673 const date = new Date ( 1452124800000 ) ;
673674 const doc = { field : date } ;
@@ -679,7 +680,7 @@ Converting circular structure to EJSON:
679680 } ) ;
680681 } ) ;
681682
682- context ( 'when using relaxed mode' , function ( ) {
683+ context ( 'when using relaxed=true mode' , function ( ) {
683684 it ( 'parses $date number with millis since epoch' , function ( ) {
684685 const date = new Date ( 1452124800000 ) ;
685686 const doc = { field : date } ;
0 commit comments