@@ -93,17 +93,17 @@ describe('volume conversions', () => {
9393
9494 test ( 'tablespoon to teaspoon (US)' , ( ) => {
9595 const result = convertUnit ( 1 , 'tablespoon' , 'teaspoon' , { fromSystem : 'us' } ) ;
96- expect ( result ) . toBeCloseTo ( 3 , 0 ) ;
96+ expect ( result ) . toBe ( 3 ) ;
9797 } ) ;
9898
9999 test ( 'pint to cup (US)' , ( ) => {
100100 const result = convertUnit ( 1 , 'pint' , 'cup' , { fromSystem : 'us' } ) ;
101- expect ( result ) . toBeCloseTo ( 2 , 0 ) ;
101+ expect ( result ) . toBe ( 2 ) ;
102102 } ) ;
103103
104104 test ( 'quart to pint (US)' , ( ) => {
105105 const result = convertUnit ( 1 , 'quart' , 'pint' , { fromSystem : 'us' } ) ;
106- expect ( result ) . toBeCloseTo ( 2 , 0 ) ;
106+ expect ( result ) . toBe ( 2 ) ;
107107 } ) ;
108108
109109 test ( 'fluid ounce to milliliter (US)' , ( ) => {
@@ -142,12 +142,12 @@ describe('length conversions', () => {
142142
143143 test ( 'foot to inch' , ( ) => {
144144 const result = convertUnit ( 1 , 'foot' , 'inch' ) ;
145- expect ( result ) . toBeCloseTo ( 12 , 0 ) ;
145+ expect ( result ) . toBe ( 12 ) ;
146146 } ) ;
147147
148148 test ( 'yard to foot' , ( ) => {
149149 const result = convertUnit ( 1 , 'yard' , 'foot' ) ;
150- expect ( result ) . toBeCloseTo ( 3 , 0 ) ;
150+ expect ( result ) . toBe ( 3 ) ;
151151 } ) ;
152152
153153 test ( 'meter to centimeter' , ( ) => {
@@ -187,12 +187,12 @@ describe('fromSystem/toSystem relationships', () => {
187187 describe ( 'same unit conversions' , ( ) => {
188188 test ( 'cup US to cup US returns 1' , ( ) => {
189189 const result = convertUnit ( 1 , 'cup' , 'cup' , { fromSystem : 'us' , toSystem : 'us' } ) ;
190- expect ( result ) . toBeCloseTo ( 1 , 5 ) ;
190+ expect ( result ) . toBe ( 1 ) ;
191191 } ) ;
192192
193193 test ( 'cup Imperial to cup Imperial returns 1' , ( ) => {
194194 const result = convertUnit ( 1 , 'cup' , 'cup' , { fromSystem : 'imperial' , toSystem : 'imperial' } ) ;
195- expect ( result ) . toBeCloseTo ( 1 , 5 ) ;
195+ expect ( result ) . toBe ( 1 ) ;
196196 } ) ;
197197
198198 test ( 'cup US to cup Imperial' , ( ) => {
@@ -208,12 +208,12 @@ describe('fromSystem/toSystem relationships', () => {
208208 } ) ;
209209
210210 test ( 'tablespoon US to tablespoon Imperial' , ( ) => {
211- // US tbsp (14.787 ml) to Imperial tbsp (17.758 ml)
211+ // US tbsp (14.786765 ml) to Imperial tbsp (15 ml)
212212 const result = convertUnit ( 1 , 'tablespoon' , 'tablespoon' , {
213213 fromSystem : 'us' ,
214214 toSystem : 'imperial' ,
215215 } ) ;
216- expect ( result ) . toBeCloseTo ( 14.787 / 17.758 , 4 ) ;
216+ expect ( result ) . toBeCloseTo ( 14.786765 / 15 , 4 ) ;
217217 } ) ;
218218
219219 test ( 'gallon Imperial to gallon US' , ( ) => {
@@ -248,16 +248,16 @@ describe('fromSystem/toSystem relationships', () => {
248248 fromSystem : 'metric' ,
249249 toSystem : 'metric' ,
250250 } ) ;
251- expect ( result ) . toBeCloseTo ( 1 , 5 ) ;
251+ expect ( result ) . toBe ( 1 ) ;
252252 } ) ;
253253
254254 test ( 'tablespoon Imperial to tablespoon metric' , ( ) => {
255- // Imperial tbsp (17.758 ml) to metric tbsp (15 ml)
255+ // Imperial tbsp (15 ml) to metric tbsp (15 ml)
256256 const result = convertUnit ( 1 , 'tablespoon' , 'tablespoon' , {
257257 fromSystem : 'imperial' ,
258258 toSystem : 'metric' ,
259259 } ) ;
260- expect ( result ) . toBeCloseTo ( 17.758 / 15 , 4 ) ;
260+ expect ( result ) . toBeCloseTo ( 15 / 15 , 4 ) ;
261261 } ) ;
262262 } ) ;
263263
@@ -276,12 +276,12 @@ describe('fromSystem/toSystem relationships', () => {
276276 } ) ;
277277
278278 test ( 'US tablespoon to Imperial teaspoon' , ( ) => {
279- // US tbsp (14.787 ml) to Imperial tsp (5.919 ml)
279+ // US tbsp (14.786765 ml) to Imperial tsp (5 ml)
280280 const result = convertUnit ( 1 , 'tablespoon' , 'teaspoon' , {
281281 fromSystem : 'us' ,
282282 toSystem : 'imperial' ,
283283 } ) ;
284- expect ( result ) . toBeCloseTo ( 14.787 / 5.919 , 3 ) ;
284+ expect ( result ) . toBeCloseTo ( 14.786765 / 5 , 3 ) ;
285285 } ) ;
286286
287287 test ( 'Imperial pint to US cup' , ( ) => {
@@ -309,12 +309,12 @@ describe('fromSystem/toSystem relationships', () => {
309309 describe ( 'units without multi-system factors' , ( ) => {
310310 test ( 'gram to gram returns 1 regardless of system' , ( ) => {
311311 const result = convertUnit ( 1 , 'gram' , 'gram' , { fromSystem : 'us' , toSystem : 'imperial' } ) ;
312- expect ( result ) . toBeCloseTo ( 1 , 5 ) ;
312+ expect ( result ) . toBe ( 1 ) ;
313313 } ) ;
314314
315315 test ( 'liter to liter returns 1 regardless of system' , ( ) => {
316316 const result = convertUnit ( 1 , 'liter' , 'liter' , { fromSystem : 'imperial' , toSystem : 'us' } ) ;
317- expect ( result ) . toBeCloseTo ( 1 , 5 ) ;
317+ expect ( result ) . toBe ( 1 ) ;
318318 } ) ;
319319
320320 test ( 'pound to kilogram same regardless of system' , ( ) => {
@@ -360,7 +360,7 @@ describe('with additionalUOMs', () => {
360360describe ( 'unit spelling variations' , ( ) => {
361361 test ( 'accepts short form units' , ( ) => {
362362 expect ( convertUnit ( 1 , 'c' , 'ml' ) ) . toBeCloseTo ( 236.588 , 2 ) ;
363- expect ( convertUnit ( 1 , 'tbsp' , 'tsp' ) ) . toBeCloseTo ( 3 , 0 ) ;
363+ expect ( convertUnit ( 1 , 'tbsp' , 'tsp' ) ) . toBe ( 3 ) ;
364364 expect ( convertUnit ( 1 , 'lb' , 'g' ) ) . toBeCloseTo ( 453.592 , 2 ) ;
365365 } ) ;
366366
@@ -370,7 +370,7 @@ describe('unit spelling variations', () => {
370370 } ) ;
371371
372372 test ( 'accepts alternate spellings' , ( ) => {
373- expect ( convertUnit ( 1 , 'T' , 'tsp' ) ) . toBeCloseTo ( 3 , 0 ) ;
373+ expect ( convertUnit ( 1 , 'T' , 'tsp' ) ) . toBe ( 3 ) ;
374374 expect ( convertUnit ( 1 , 'lbs' , 'g' ) ) . toBeCloseTo ( 453.592 , 2 ) ;
375375 } ) ;
376376
@@ -425,7 +425,7 @@ describe('fromSystem and toSystem case-insensitivity', () => {
425425 fromSystem : 'METRIC' as UnitSystem ,
426426 toSystem : 'metric' ,
427427 } ) ;
428- expect ( result ) . toBeCloseTo ( 1 , 5 ) ;
428+ expect ( result ) . toBe ( 1 ) ;
429429 } ) ;
430430
431431 test ( 'mixed case produces same result as lowercase' , ( ) => {
0 commit comments