Skip to content

Commit 2effe12

Browse files
author
veeck
committed
add some tests
1 parent 06b57b2 commit 2effe12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/unit/modules/default/weather/weather_utils_spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ const WeatherUtils = require("../../../../../modules/default/weather/weatherutil
33

44
describe("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", () => {

0 commit comments

Comments
 (0)