diff --git a/modules/default/weather/providers/ukmetoffice.js b/modules/default/weather/providers/ukmetoffice.js index 54ebed16..d7aa9886 100755 --- a/modules/default/weather/providers/ukmetoffice.js +++ b/modules/default/weather/providers/ukmetoffice.js @@ -82,7 +82,7 @@ WeatherProvider.register("ukmetoffice", { let timeInMins = nowUtc.diff(midnightUtc, "minutes"); // loop round each of the (5) periods, look for today (the first period may be yesterday) - for (i in currentWeatherData.SiteRep.DV.Location.Period) { + for (var i in currentWeatherData.SiteRep.DV.Location.Period) { let periodDate = moment.utc(currentWeatherData.SiteRep.DV.Location.Period[i].value.substr(0,10), "YYYY-MM-DD"); // ignore if period is before today @@ -92,7 +92,7 @@ WeatherProvider.register("ukmetoffice", { if (moment().diff(periodDate, "minutes") > 0) { // loop round the reports looking for the one we are in // $ value specifies the time in minutes-of-the-day: 0, 180, 360,...1260 - for (j in currentWeatherData.SiteRep.DV.Location.Period[i].Rep){ + for (var j in currentWeatherData.SiteRep.DV.Location.Period[i].Rep){ let p = currentWeatherData.SiteRep.DV.Location.Period[i].Rep[j].$; if (timeInMins >= p && timeInMins-180 < p) { // finally got the one we want, so populate weather object @@ -126,11 +126,11 @@ WeatherProvider.register("ukmetoffice", { // loop round the (5) periods getting the data // for each period array, Day is [0], Night is [1] - for (j in forecasts.SiteRep.DV.Location.Period) { + for (var j in forecasts.SiteRep.DV.Location.Period) { const weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); // data times are always UTC - dateStr = forecasts.SiteRep.DV.Location.Period[j].value; + const dateStr = forecasts.SiteRep.DV.Location.Period[j].value; let periodDate = moment.utc(dateStr.substr(0,10), "YYYY-MM-DD"); // ignore if period is before today diff --git a/tests/configs/modules/positions.js b/tests/configs/modules/positions.js index d2bf5ee9..1d36a0c0 100644 --- a/tests/configs/modules/positions.js +++ b/tests/configs/modules/positions.js @@ -26,7 +26,7 @@ var config = { "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"]; var modules = Array(); - for (idx in positions) { + for (var idx in positions) { modules.push({ module: "helloworld", position: positions[idx], diff --git a/tests/unit/functions/calendar_spec.js b/tests/unit/functions/calendar_spec.js index 6e4fe988..8c8df684 100644 --- a/tests/unit/functions/calendar_spec.js +++ b/tests/unit/functions/calendar_spec.js @@ -17,7 +17,7 @@ describe("Functions into modules/default/calendar/calendar.js", function() { }); describe("capFirst", function() { - words = { + const words = { "rodrigo": "Rodrigo", "123m": "123m", "magic mirror": "Magic mirror", @@ -89,7 +89,7 @@ describe("Functions into modules/default/calendar/calendar.js", function() { }); describe("shorten", function() { - strings = { + const strings = { " String with whitespace at the beginning that needs trimming" : { length: 16, return: "String with whit…" }, "long string that needs shortening": { length: 16, return: "long string that…" }, "short string": { length: 16, return: "short string" }, diff --git a/tests/unit/functions/newsfeed_spec.js b/tests/unit/functions/newsfeed_spec.js index c6bb34f2..937f57ee 100644 --- a/tests/unit/functions/newsfeed_spec.js +++ b/tests/unit/functions/newsfeed_spec.js @@ -12,7 +12,7 @@ describe("Functions into modules/default/newsfeed/newsfeed.js", function() { require("../../../modules/default/newsfeed/newsfeed.js"); describe("capitalizeFirstLetter", function() { - words = { + const words = { "rodrigo": "Rodrigo", "123m": "123m", "magic mirror": "Magic mirror", diff --git a/tests/unit/global_vars/root_path_spec.js b/tests/unit/global_vars/root_path_spec.js index f5469e80..3f162dfe 100644 --- a/tests/unit/global_vars/root_path_spec.js +++ b/tests/unit/global_vars/root_path_spec.js @@ -62,7 +62,7 @@ describe("'global.root_path' set in js/app.js", function() { }); it("should expect the global.version equals package.json file", function() { - versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version; + const versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version; expect(this.sandbox.global.version).to.equal(versionPackage); }); });