@@ -26,32 +26,26 @@ describe("encode", () => {
2626 } ) ;
2727
2828 context ( "forceFloat" , ( ) => {
29- it ( "encodes integers as integers without forceFloat " , ( ) => {
29+ it ( "encodes integers as integers without forceIntegerToFloat " , ( ) => {
3030 assert . deepStrictEqual ( encode ( 3 ) , Uint8Array . from ( [ 0x3 ] ) ) ;
3131 } ) ;
3232
33- it ( "encodes integers as floating point when forceFloat =true" , ( ) => {
33+ it ( "encodes integers as floating point when forceIntegerToFloat =true" , ( ) => {
3434 assert . deepStrictEqual (
35- encode ( 3 , { forceFloat : true } ) ,
35+ encode ( 3 , { forceIntegerToFloat : true } ) ,
3636 Uint8Array . from ( [ 0xcb , 0x40 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ] ) ,
3737 ) ;
3838 } ) ;
3939
40- it ( "encodes integers as floating point when forceFloat =true" , ( ) => {
40+ it ( "encodes integers as float32 when forceIntegerToFloat=true and forceFloat32 =true" , ( ) => {
4141 assert . deepStrictEqual (
42- encode ( 3 , { forceFloat : true } ) ,
43- Uint8Array . from ( [ 0xcb , 0x40 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ] ) ,
42+ encode ( 3 , { forceIntegerToFloat : true , forceFloat32 : true } ) ,
43+ Uint8Array . from ( [ 0xca , 0x40 , 0x40 , 0x00 , 0x00 ] ) ,
4444 ) ;
4545 } ) ;
4646
47- it ( "encodes integers as float32 when forceFloat=true and forceFloat32=true" , ( ) => {
48- assert . deepStrictEqual (
49- encode ( 3 , { forceFloat : true , forceFloat32 : true } ) ,
50- Uint8Array . from ( [ 0xca , 0x40 , 0x40 , 0x00 , 0x00 ] ) ) ;
51- } ) ;
52-
53- it ( "encodes integers as integers when forceFloat=false" , ( ) => {
54- assert . deepStrictEqual ( encode ( 3 , { forceFloat : false } ) , Uint8Array . from ( [ 0x3 ] ) ) ;
47+ it ( "encodes integers as integers when forceIntegerToFloat=false" , ( ) => {
48+ assert . deepStrictEqual ( encode ( 3 , { forceIntegerToFloat : false } ) , Uint8Array . from ( [ 0x3 ] ) ) ;
5549 } ) ;
5650 } ) ;
5751
0 commit comments