File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,28 @@ describe('class Binary', () => {
8181 } ) ;
8282
8383 context ( 'inspect()' , ( ) => {
84+ it ( 'when value is default returns "new Binary()"' , ( ) => {
85+ expect ( new Binary ( ) . inspect ( ) ) . to . equal ( 'new Binary()' ) ;
86+ } ) ;
87+
88+ it ( 'when value is empty returns "new Binary()"' , ( ) => {
89+ expect ( new Binary ( new Uint8Array ( 0 ) ) . inspect ( ) ) . to . equal ( 'new Binary()' ) ;
90+ } ) ;
91+
92+ it ( 'when value is default with a subtype returns "new Binary()"' , ( ) => {
93+ expect ( new Binary ( null , 0x23 ) . inspect ( ) ) . to . equal ( 'new Binary(undefined, 35)' ) ;
94+ } ) ;
95+
96+ it ( 'when value is empty with a subtype returns "new Binary(undefined, 35)"' , ( ) => {
97+ expect ( new Binary ( new Uint8Array ( 0 ) , 0x23 ) . inspect ( ) ) . to . equal ( 'new Binary(undefined, 35)' ) ;
98+ } ) ;
99+
100+ it ( 'when value is empty returns "Binary.createFromBase64("", 0)"' , ( ) => {
101+ expect ( new Binary ( Buffer . from ( 'abcdef' , 'utf8' ) ) . inspect ( ) ) . to . equal (
102+ 'Binary.createFromBase64("YWJjZGVm", 0)'
103+ ) ;
104+ } ) ;
105+
84106 context ( 'when result is executed' , ( ) => {
85107 it ( 'is deep equal with a Binary that has no data' , ( ) => {
86108 const bsonValue = new Binary ( ) ;
You can’t perform that action at this time.
0 commit comments