mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Fix tomezone test error as reported by @khassel
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
const WeatherObject = require("../../../modules/default/weather/weatherobject.js");
|
const WeatherObject = require("../../../modules/default/weather/weatherobject.js");
|
||||||
|
|
||||||
global.moment = require("moment");
|
global.moment = require("moment-timezone");
|
||||||
global.SunCalc = require("suncalc");
|
global.SunCalc = require("suncalc");
|
||||||
|
|
||||||
describe("WeatherObject", function () {
|
describe("WeatherObject", function () {
|
||||||
|
let originalTimeZone;
|
||||||
let weatherobject;
|
let weatherobject;
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
|
originalTimeZone = moment.tz.guess();
|
||||||
|
moment.tz.setDefault("Africa/Dar_es_Salaam");
|
||||||
weatherobject = new WeatherObject("metric", "metric", "metric", true);
|
weatherobject = new WeatherObject("metric", "metric", "metric", true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -21,4 +24,8 @@ describe("WeatherObject", function () {
|
|||||||
weatherobject.updateSunTime(-6.774877582342688, 37.63345667023327);
|
weatherobject.updateSunTime(-6.774877582342688, 37.63345667023327);
|
||||||
expect(weatherobject.isDayTime()).toBe(false);
|
expect(weatherobject.isDayTime()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterAll(function () {
|
||||||
|
moment.tz.setDefault(originalTimeZone);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user