Update some tests (#3024)

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2023-02-07 00:03:08 +01:00
committed by GitHub
parent bf279d9a57
commit 1dc0a0d5b5
3 changed files with 13 additions and 7 deletions

View File

@@ -49,6 +49,11 @@ describe("WeatherObject", () => {
});
describe("WeatherUtils", () => {
it("should convert windspeed correctly from mps to beaufort", () => {
expect(Math.round(WeatherUtils.convertWind(5, "beaufort"))).toBe(3);
expect(Math.round(WeatherUtils.convertWind(42, "beaufort"))).toBe(12);
});
it("should convert windspeed correctly from mph to mps", () => {
expect(Math.round(WeatherUtils.convertWindToMetric(93.951324266285))).toBe(42);
});
@@ -64,4 +69,8 @@ describe("WeatherUtils", () => {
it("should return a calculated feelsLike info", () => {
expect(WeatherUtils.calculateFeelsLike(0, 20, 40)).toBe(-9.444444444444445);
});
it("should return a calculated feelsLike info", () => {
expect(WeatherUtils.calculateFeelsLike(30, 0, 60)).toBe(32.8320322777777);
});
});