File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
tests/unit/modules/default/weather Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,17 @@ const WeatherUtils = require("../../../../../modules/default/weather/weatherutil
33
44describe ( "Weather utils tests" , ( ) => {
55 describe ( "temperature conversion to imperial" , ( ) => {
6+ it ( "should convert temp correctly from Celsius to Celsius" , ( ) => {
7+ expect ( Math . round ( WeatherUtils . convertTemp ( 10 , "metric" ) ) ) . toBe ( 10 ) ;
8+ } ) ;
9+
610 it ( "should convert temp correctly from Celsius to Fahrenheit" , ( ) => {
711 expect ( Math . round ( WeatherUtils . convertTemp ( 10 , "imperial" ) ) ) . toBe ( 50 ) ;
812 } ) ;
13+
14+ it ( "should convert temp correctly from Fahrenheit to Celsius" , ( ) => {
15+ expect ( Math . round ( WeatherUtils . convertTempToMetric ( 10 ) ) ) . toBe ( - 12 ) ;
16+ } ) ;
917 } ) ;
1018
1119 describe ( "windspeed conversion to beaufort" , ( ) => {
You can’t perform that action at this time.
0 commit comments