mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Fixed Unit test case error for #2221
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* eslint no-multi-spaces: 0 */
|
||||
const expect = require("chai").expect;
|
||||
const moment = require("moment-timezone");
|
||||
var data = require("../functions/weatherforecast_data.json");
|
||||
|
||||
describe("Functions module weatherforecast", function () {
|
||||
@@ -69,6 +70,16 @@ describe("Functions module weatherforecast", function () {
|
||||
Log = {
|
||||
error: function () {}
|
||||
};
|
||||
|
||||
var originalLocale;
|
||||
var originalTimeZone;
|
||||
before(function () {
|
||||
originalLocale = moment.locale();
|
||||
originalTimeZone = moment.tz.guess();
|
||||
moment.locale("hi");
|
||||
moment.tz.setDefault("Europe/Warsaw");
|
||||
});
|
||||
|
||||
describe("forecastIcons sunset specified", function () {
|
||||
before(function () {
|
||||
Module.definitions.weatherforecast.Log = {};
|
||||
@@ -97,5 +108,10 @@ describe("Functions module weatherforecast", function () {
|
||||
expect(forecastData[2].icon).to.equal("wi-rain");
|
||||
});
|
||||
});
|
||||
|
||||
after(function () {
|
||||
moment.locale(originalLocale);
|
||||
moment.tz.setDefault(originalTimeZone);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user