@@ -8,18 +8,18 @@ describe("encode", () => {
88 } ) ;
99 } ) ;
1010
11- context ( "preferFloat32 " , ( ) => {
12- it ( "encodes numbers in float64 wihout preferFloat32 " , ( ) => {
11+ context ( "forceFloat32 " , ( ) => {
12+ it ( "encodes numbers in float64 wihout forceFloat32 " , ( ) => {
1313 assert . deepStrictEqual ( encode ( 3.14 ) , Uint8Array . from ( [ 0xcb , 0x40 , 0x9 , 0x1e , 0xb8 , 0x51 , 0xeb , 0x85 , 0x1f ] ) ) ;
1414 } ) ;
1515
16- it ( "encodes numbers in float32 when preferFloate32 =true" , ( ) => {
17- assert . deepStrictEqual ( encode ( 3.14 , { preferFloat32 : true } ) , Uint8Array . from ( [ 0xca , 0x40 , 0x48 , 0xf5 , 0xc3 ] ) ) ;
16+ it ( "encodes numbers in float32 when forceFloate32 =true" , ( ) => {
17+ assert . deepStrictEqual ( encode ( 3.14 , { forceFloat32 : true } ) , Uint8Array . from ( [ 0xca , 0x40 , 0x48 , 0xf5 , 0xc3 ] ) ) ;
1818 } ) ;
1919
20- it ( "encodes numbers in float64 with preferFloat32 =false" , ( ) => {
20+ it ( "encodes numbers in float64 with forceFloat32 =false" , ( ) => {
2121 assert . deepStrictEqual (
22- encode ( 3.14 , { preferFloat32 : false } ) ,
22+ encode ( 3.14 , { forceFloat32 : false } ) ,
2323 Uint8Array . from ( [ 0xcb , 0x40 , 0x9 , 0x1e , 0xb8 , 0x51 , 0xeb , 0x85 , 0x1f ] ) ,
2424 ) ;
2525 } ) ;
0 commit comments