diff --git a/CHANGELOG.md b/CHANGELOG.md index 06b6404c..b6e7ba29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ _This release is scheduled to be released on 2021-10-01._ - Refactor test configs, use default test config for all tests. - Updated github templates. - Actually test all js and css files when lint script is run. +- Update jsdocs and print warnings during testing too ### Fixed diff --git a/modules/default/weather/providers/smhi.js b/modules/default/weather/providers/smhi.js index c7155193..244fc1de 100644 --- a/modules/default/weather/providers/smhi.js +++ b/modules/default/weather/providers/smhi.js @@ -102,7 +102,7 @@ WeatherProvider.register("smhi", { * * @param {object} weatherData Weatherdata to convert * @param {object} coordinates Coordinates of the locations of the weather - * @returns {WeatherObject} + * @returns {WeatherObject} The converted weatherdata at the specified location */ convertWeatherDataToObject(weatherData, coordinates) { let currentWeather = new WeatherObject("metric", "metric", "metric"); //Weather data is only for Sweden and nobody in Sweden would use imperial @@ -145,9 +145,9 @@ WeatherProvider.register("smhi", { /** * Takes all of the data points and converts it to one WeatherObject per day. * - * @param allWeatherData - * @param {object} coordinates - * @returns {*[]} + * @param {object[]} allWeatherData Array of weatherdata + * @param {object} coordinates Coordinates of the locations of the weather + * @returns {WeatherObject[]} Array of weatherobjects */ convertWeatherDataGroupedByDay(allWeatherData, coordinates) { let currentWeather; @@ -204,8 +204,8 @@ WeatherProvider.register("smhi", { /** * Checks if the weatherObject is at dayTime. * - * @param weatherObject - * @returns {boolean} + * @param {WeatherObject} weatherObject The weatherObject to look at + * @returns {boolean} true if it is at dayTime */ isDayTime(weatherObject) { return weatherObject.date.isBetween(weatherObject.sunrise, weatherObject.sunset, undefined, "[]"); @@ -235,12 +235,11 @@ WeatherProvider.register("smhi", { }, /** - * Helper method to fetch a property from the returned data set. - * The returned values is an array with always one value in it. + * Helper method to get a property from the returned data set. * - * @param {object} weatherData Weatherdata to fetch from + * @param {object} currentWeatherData Weatherdata to get from * @param {string} name The name of the property - * @returns {unknown} + * @returns {*} The value of the property in the weatherdata */ paramValue(currentWeatherData, name) { return currentWeatherData.parameters.filter((p) => p.name === name).flatMap((p) => p.values)[0]; @@ -251,9 +250,9 @@ WeatherProvider.register("smhi", { * Uses different icons depending if its daytime or nighttime. * SHMI's description of what the numeric value means is the comment after the case. * - * @param input - * @param isDayTime - * @returns {string|string} + * @param {number} input The smhi icon value + * @param {boolean} isDayTime True if the icon should be for daytime, false for nightime + * @returns {string} The icon name for the MagicMirror */ convertWeatherType(input, isDayTime) { switch (input) { diff --git a/package-lock.json b/package-lock.json index 94e2e4d9..82c8dcbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "express-basic-auth": "^1.2.0", "husky": "^7.0.1", "jest": "^27.0.6", - "jsdom": "^16.6.0", + "jsdom": "^16.7.0", "lodash": "^4.17.21", "nyc": "^15.1.0", "prettier": "^2.3.2", @@ -50,7 +50,7 @@ "node": ">=12" }, "optionalDependencies": { - "electron": "^13.1.7" + "electron": "^13.1.8" } }, "node_modules/@babel/code-frame": { @@ -3243,9 +3243,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "node_modules/electron": { - "version": "13.1.7", - "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.7.tgz", - "integrity": "sha512-sVfpP/0s6a82FK32LMuEe9L+aWZw15u3uYn9xUJArPjy4OZHteE6yM5871YCNXNiDnoCLQ5eqQWipiVgHsf8nQ==", + "version": "13.1.8", + "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.8.tgz", + "integrity": "sha512-ei2ZyyG81zUOlvm5Zxri668TdH5GNLY0wF+XrC2FRCqa8AABAPjJIWTRkhFEr/H6PDVPNZjMPvSs3XhHyVVk2g==", "devOptional": true, "hasInstallScript": true, "dependencies": { @@ -6012,9 +6012,9 @@ } }, "node_modules/jsdom": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", - "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", "dev": true, "dependencies": { "abab": "^2.0.5", @@ -6042,7 +6042,7 @@ "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.5.0", - "ws": "^7.4.5", + "ws": "^7.4.6", "xml-name-validator": "^3.0.0" }, "engines": { @@ -12916,9 +12916,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron": { - "version": "13.1.7", - "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.7.tgz", - "integrity": "sha512-sVfpP/0s6a82FK32LMuEe9L+aWZw15u3uYn9xUJArPjy4OZHteE6yM5871YCNXNiDnoCLQ5eqQWipiVgHsf8nQ==", + "version": "13.1.8", + "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.8.tgz", + "integrity": "sha512-ei2ZyyG81zUOlvm5Zxri668TdH5GNLY0wF+XrC2FRCqa8AABAPjJIWTRkhFEr/H6PDVPNZjMPvSs3XhHyVVk2g==", "devOptional": true, "requires": { "@electron/get": "^1.0.1", @@ -14994,9 +14994,9 @@ "dev": true }, "jsdom": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", - "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", "dev": true, "requires": { "abab": "^2.0.5", @@ -15024,7 +15024,7 @@ "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.5.0", - "ws": "^7.4.5", + "ws": "^7.4.6", "xml-name-validator": "^3.0.0" }, "dependencies": { diff --git a/package.json b/package.json index 9f51c5d8..cec44b26 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test:e2e": "NODE_ENV=test jest --selectProjects e2e -i --forceExit", "test:unit": "NODE_ENV=test jest --selectProjects unit -i --forceExit", "test:prettier": "prettier . --check", - "test:js": "eslint 'js/**/*.js' 'modules/default/**/*.js' 'clientonly/*.js' 'serveronly/*.js' 'translations/*.js' 'vendor/*.js' 'tests/**/*.js' 'config/*' --config .eslintrc.json --quiet", + "test:js": "eslint 'js/**/*.js' 'modules/default/**/*.js' 'clientonly/*.js' 'serveronly/*.js' 'translations/*.js' 'vendor/*.js' 'tests/**/*.js' 'config/*' --config .eslintrc.json", "test:css": "stylelint 'css/main.css' 'fonts/*.css' 'modules/default/**/*.css' 'vendor/*.css' --config .stylelintrc.json", "test:calendar": "node ./modules/default/calendar/debug.js", "config:check": "node js/check_config.js", @@ -52,7 +52,7 @@ "express-basic-auth": "^1.2.0", "husky": "^7.0.1", "jest": "^27.0.6", - "jsdom": "^16.6.0", + "jsdom": "^16.7.0", "lodash": "^4.17.21", "nyc": "^15.1.0", "prettier": "^2.3.2", @@ -65,7 +65,7 @@ "stylelint-prettier": "^1.2.0" }, "optionalDependencies": { - "electron": "^13.1.7" + "electron": "^13.1.8" }, "dependencies": { "colors": "^1.4.0", diff --git a/tests/unit/classes/translator_spec.js b/tests/unit/classes/translator_spec.js index 2756b41b..09e14f20 100644 --- a/tests/unit/classes/translator_spec.js +++ b/tests/unit/classes/translator_spec.js @@ -68,7 +68,7 @@ describe("Translator", function () { }; /** - * @param Translator + * @param {object} Translator the global Translator object */ function setTranslations(Translator) { Translator.translations = translations;