From a7ae79493d447bfd3d1d4d85b8ec433e82151237 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Mon, 5 Jul 2021 00:33:50 +0200 Subject: [PATCH] refactor test config --- CHANGELOG.md | 1 + tests/configs/default.js | 21 +++++++++++++++++++ tests/configs/empty_ipWhiteList.js | 19 ++--------------- tests/configs/env.js | 17 +-------------- tests/configs/modules/alert/default.js | 16 ++------------ .../configs/modules/calendar/auth-default.js | 14 ++----------- tests/configs/modules/calendar/basic-auth.js | 14 ++----------- .../configs/modules/calendar/changed-port.js | 14 ++----------- tests/configs/modules/calendar/custom.js | 14 ++----------- tests/configs/modules/calendar/default.js | 14 ++----------- .../modules/calendar/fail-basic-auth.js | 14 ++----------- .../modules/calendar/old-basic-auth.js | 14 ++----------- tests/configs/modules/calendar/recurring.js | 14 ++----------- tests/configs/modules/clock/clock_12hr.js | 14 ++----------- tests/configs/modules/clock/clock_24hr.js | 16 ++------------ tests/configs/modules/clock/clock_analog.js | 16 ++------------ .../clock/clock_displaySeconds_false.js | 14 ++----------- .../modules/clock/clock_showPeriodUpper.js | 14 ++----------- tests/configs/modules/clock/clock_showWeek.js | 14 ++----------- tests/configs/modules/clock/es/clock_12hr.js | 13 ++---------- tests/configs/modules/clock/es/clock_24hr.js | 14 ++----------- .../modules/clock/es/clock_showPeriodUpper.js | 13 ++---------- .../modules/clock/es/clock_showWeek.js | 13 ++---------- .../compliments/compliments_anytime.js | 14 ++----------- .../modules/compliments/compliments_date.js | 14 ++----------- .../compliments/compliments_only_anytime.js | 14 ++----------- .../compliments/compliments_parts_day.js | 14 ++----------- tests/configs/modules/display.js | 8 ++----- .../configs/modules/helloworld/helloworld.js | 16 ++------------ .../modules/helloworld/helloworld_default.js | 16 ++------------ tests/configs/modules/newsfeed/default.js | 14 ++----------- .../configs/modules/newsfeed/incorrect_url.js | 14 ++----------- .../modules/newsfeed/prohibited_words.js | 14 ++----------- tests/configs/modules/positions.js | 16 ++------------ .../weather/currentweather_compliments.js | 17 ++------------- .../modules/weather/currentweather_default.js | 14 ++----------- .../modules/weather/currentweather_options.js | 16 ++------------ .../modules/weather/currentweather_units.js | 14 ++----------- .../weather/forecastweather_default.js | 14 ++----------- .../weather/forecastweather_options.js | 14 ++----------- .../modules/weather/forecastweather_units.js | 14 ++----------- tests/configs/noIpWhiteList.js | 19 ++--------------- tests/configs/port_8090.js | 19 ++--------------- tests/configs/without_modules.js | 17 ++------------- 44 files changed, 105 insertions(+), 534 deletions(-) create mode 100644 tests/configs/default.js diff --git a/CHANGELOG.md b/CHANGELOG.md index f3583ff7..36dcf39d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ _This release is scheduled to be released on 2021-07-01._ ### Updated - Bump electron to v13 (and spectron to v15) and update other dependencies in package.json. +- Refactor test configs, use default test config for all tests. ### Fixed diff --git a/tests/configs/default.js b/tests/configs/default.js new file mode 100644 index 00000000..fe066d19 --- /dev/null +++ b/tests/configs/default.js @@ -0,0 +1,21 @@ +let config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 24, + units: "metric", + electronOptions: { + webPreferences: { + nodeIntegration: true, + enableRemoteModule: true, + contextIsolation: false + } + }, + + modules: [] +}; + +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/empty_ipWhiteList.js b/tests/configs/empty_ipWhiteList.js index 4b0d4057..1c9353b5 100644 --- a/tests/configs/empty_ipWhiteList.js +++ b/tests/configs/empty_ipWhiteList.js @@ -3,23 +3,8 @@ * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: [], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - - modules: [] -}; +let config = require('./default.js'); +config.ipWhitelist = []; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/env.js b/tests/configs/env.js index e05424c8..9386d1c5 100644 --- a/tests/configs/env.js +++ b/tests/configs/env.js @@ -3,23 +3,8 @@ * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - - modules: [] -}; +let config = require('./default.js'); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/alert/default.js b/tests/configs/modules/alert/default.js index 8a358ec8..0713079b 100644 --- a/tests/configs/modules/alert/default.js +++ b/tests/configs/modules/alert/default.js @@ -4,20 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "alert", @@ -29,6 +15,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/auth-default.js b/tests/configs/modules/calendar/auth-default.js index 8eabfe21..0bc6bc78 100644 --- a/tests/configs/modules/calendar/auth-default.js +++ b/tests/configs/modules/calendar/auth-default.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -38,6 +26,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/basic-auth.js b/tests/configs/modules/calendar/basic-auth.js index 342da0e2..4243a237 100644 --- a/tests/configs/modules/calendar/basic-auth.js +++ b/tests/configs/modules/calendar/basic-auth.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -39,6 +27,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/changed-port.js b/tests/configs/modules/calendar/changed-port.js index ef59aea9..02f6d385 100644 --- a/tests/configs/modules/calendar/changed-port.js +++ b/tests/configs/modules/calendar/changed-port.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -38,6 +26,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/custom.js b/tests/configs/modules/calendar/custom.js index 721c0990..7e34bddd 100644 --- a/tests/configs/modules/calendar/custom.js +++ b/tests/configs/modules/calendar/custom.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -38,6 +26,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/default.js b/tests/configs/modules/calendar/default.js index ccb37af8..a532dd8d 100644 --- a/tests/configs/modules/calendar/default.js +++ b/tests/configs/modules/calendar/default.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -34,6 +22,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/fail-basic-auth.js b/tests/configs/modules/calendar/fail-basic-auth.js index 0ab1bdde..17427e63 100644 --- a/tests/configs/modules/calendar/fail-basic-auth.js +++ b/tests/configs/modules/calendar/fail-basic-auth.js @@ -6,19 +6,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -41,6 +29,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/old-basic-auth.js b/tests/configs/modules/calendar/old-basic-auth.js index 519acc9b..7ac4f930 100644 --- a/tests/configs/modules/calendar/old-basic-auth.js +++ b/tests/configs/modules/calendar/old-basic-auth.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -36,6 +24,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/calendar/recurring.js b/tests/configs/modules/calendar/recurring.js index a085ad07..04691813 100644 --- a/tests/configs/modules/calendar/recurring.js +++ b/tests/configs/modules/calendar/recurring.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -35,6 +23,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/clock_12hr.js b/tests/configs/modules/clock/clock_12hr.js index 9de222ed..016a10a4 100644 --- a/tests/configs/modules/clock/clock_12hr.js +++ b/tests/configs/modules/clock/clock_12hr.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -26,6 +14,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/clock_24hr.js b/tests/configs/modules/clock/clock_24hr.js index e5ec59e3..899d1e0a 100644 --- a/tests/configs/modules/clock/clock_24hr.js +++ b/tests/configs/modules/clock/clock_24hr.js @@ -4,20 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "clock", @@ -26,6 +12,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/clock_analog.js b/tests/configs/modules/clock/clock_analog.js index c76c10eb..54295b4f 100644 --- a/tests/configs/modules/clock/clock_analog.js +++ b/tests/configs/modules/clock/clock_analog.js @@ -3,20 +3,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "clock", @@ -29,6 +15,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/clock_displaySeconds_false.js b/tests/configs/modules/clock/clock_displaySeconds_false.js index e74019d3..b39c0322 100644 --- a/tests/configs/modules/clock/clock_displaySeconds_false.js +++ b/tests/configs/modules/clock/clock_displaySeconds_false.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -29,6 +17,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/clock_showPeriodUpper.js b/tests/configs/modules/clock/clock_showPeriodUpper.js index 6819de54..a18c5b56 100644 --- a/tests/configs/modules/clock/clock_showPeriodUpper.js +++ b/tests/configs/modules/clock/clock_showPeriodUpper.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -29,6 +17,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/clock_showWeek.js b/tests/configs/modules/clock/clock_showWeek.js index 26b16194..63ba437f 100644 --- a/tests/configs/modules/clock/clock_showWeek.js +++ b/tests/configs/modules/clock/clock_showWeek.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -29,6 +17,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/es/clock_12hr.js b/tests/configs/modules/clock/es/clock_12hr.js index ed9d390d..d1c1d0e5 100644 --- a/tests/configs/modules/clock/es/clock_12hr.js +++ b/tests/configs/modules/clock/es/clock_12hr.js @@ -4,19 +4,8 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - language: "es", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -26,6 +15,8 @@ let config = { ] }; +config = Object.assign(require("../../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/es/clock_24hr.js b/tests/configs/modules/clock/es/clock_24hr.js index 985d579c..41d3e60b 100644 --- a/tests/configs/modules/clock/es/clock_24hr.js +++ b/tests/configs/modules/clock/es/clock_24hr.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - language: "es", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -26,6 +14,8 @@ let config = { ] }; +config = Object.assign(require("../../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/es/clock_showPeriodUpper.js b/tests/configs/modules/clock/es/clock_showPeriodUpper.js index 29c02155..6f8fb1d2 100644 --- a/tests/configs/modules/clock/es/clock_showPeriodUpper.js +++ b/tests/configs/modules/clock/es/clock_showPeriodUpper.js @@ -4,19 +4,8 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - language: "es", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -29,6 +18,8 @@ let config = { ] }; +config = Object.assign(require("../../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/clock/es/clock_showWeek.js b/tests/configs/modules/clock/es/clock_showWeek.js index 95803d5a..dc90b1ed 100644 --- a/tests/configs/modules/clock/es/clock_showWeek.js +++ b/tests/configs/modules/clock/es/clock_showWeek.js @@ -5,19 +5,8 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - language: "es", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -30,6 +19,8 @@ let config = { ] }; +config = Object.assign(require("../../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/compliments/compliments_anytime.js b/tests/configs/modules/compliments/compliments_anytime.js index 8cc0fc07..acf5b684 100644 --- a/tests/configs/modules/compliments/compliments_anytime.js +++ b/tests/configs/modules/compliments/compliments_anytime.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -34,6 +22,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/compliments/compliments_date.js b/tests/configs/modules/compliments/compliments_date.js index 8403d10c..38ec2b7c 100644 --- a/tests/configs/modules/compliments/compliments_date.js +++ b/tests/configs/modules/compliments/compliments_date.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -35,6 +23,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/compliments/compliments_only_anytime.js b/tests/configs/modules/compliments/compliments_only_anytime.js index 758ac9b2..47d24fb5 100644 --- a/tests/configs/modules/compliments/compliments_only_anytime.js +++ b/tests/configs/modules/compliments/compliments_only_anytime.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -31,6 +19,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/compliments/compliments_parts_day.js b/tests/configs/modules/compliments/compliments_parts_day.js index 51d5ea89..2d475c01 100644 --- a/tests/configs/modules/compliments/compliments_parts_day.js +++ b/tests/configs/modules/compliments/compliments_parts_day.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,6 +21,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/display.js b/tests/configs/modules/display.js index aae06520..1ea3ec97 100644 --- a/tests/configs/modules/display.js +++ b/tests/configs/modules/display.js @@ -4,12 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", electronOptions: { fullscreen: false, width: 800, @@ -40,6 +34,8 @@ let config = { ] }; +config = Object.assign(require("../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/helloworld/helloworld.js b/tests/configs/modules/helloworld/helloworld.js index 3f83a0f9..126cadca 100644 --- a/tests/configs/modules/helloworld/helloworld.js +++ b/tests/configs/modules/helloworld/helloworld.js @@ -4,20 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "helloworld", @@ -29,6 +15,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/helloworld/helloworld_default.js b/tests/configs/modules/helloworld/helloworld_default.js index a0a9a29e..e091c796 100644 --- a/tests/configs/modules/helloworld/helloworld_default.js +++ b/tests/configs/modules/helloworld/helloworld_default.js @@ -4,20 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "helloworld", @@ -26,6 +12,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/newsfeed/default.js b/tests/configs/modules/newsfeed/default.js index 59cf7d02..649bbcdd 100644 --- a/tests/configs/modules/newsfeed/default.js +++ b/tests/configs/modules/newsfeed/default.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -34,6 +22,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/newsfeed/incorrect_url.js b/tests/configs/modules/newsfeed/incorrect_url.js index afb093e0..242ad992 100644 --- a/tests/configs/modules/newsfeed/incorrect_url.js +++ b/tests/configs/modules/newsfeed/incorrect_url.js @@ -3,19 +3,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,6 +21,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/newsfeed/prohibited_words.js b/tests/configs/modules/newsfeed/prohibited_words.js index a21dd475..15ac8dd7 100644 --- a/tests/configs/modules/newsfeed/prohibited_words.js +++ b/tests/configs/modules/newsfeed/prohibited_words.js @@ -3,19 +3,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -35,6 +23,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/positions.js b/tests/configs/modules/positions.js index a69b26fd..d3229532 100644 --- a/tests/configs/modules/positions.js +++ b/tests/configs/modules/positions.js @@ -4,20 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: // Using exotic content. This is why don't accept go to JSON configuration file (function () { @@ -36,6 +22,8 @@ let config = { })() }; +config = Object.assign(require("../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/currentweather_compliments.js b/tests/configs/modules/weather/currentweather_compliments.js index 257c92cf..3b47ea65 100644 --- a/tests/configs/modules/weather/currentweather_compliments.js +++ b/tests/configs/modules/weather/currentweather_compliments.js @@ -4,21 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - fullscreen: false, - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "compliments", @@ -42,6 +27,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/currentweather_default.js b/tests/configs/modules/weather/currentweather_default.js index 0cdac111..7e9859c7 100644 --- a/tests/configs/modules/weather/currentweather_default.js +++ b/tests/configs/modules/weather/currentweather_default.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -31,6 +19,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/currentweather_options.js b/tests/configs/modules/weather/currentweather_options.js index 568c7006..30f14e3b 100644 --- a/tests/configs/modules/weather/currentweather_options.js +++ b/tests/configs/modules/weather/currentweather_options.js @@ -4,20 +4,6 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - modules: [ { module: "weather", @@ -37,6 +23,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/currentweather_units.js b/tests/configs/modules/weather/currentweather_units.js index 4c18a5eb..e6a487a7 100644 --- a/tests/configs/modules/weather/currentweather_units.js +++ b/tests/configs/modules/weather/currentweather_units.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, units: "imperial", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,6 +21,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/forecastweather_default.js b/tests/configs/modules/weather/forecastweather_default.js index fc374c3b..c9385515 100644 --- a/tests/configs/modules/weather/forecastweather_default.js +++ b/tests/configs/modules/weather/forecastweather_default.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,6 +21,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/forecastweather_options.js b/tests/configs/modules/weather/forecastweather_options.js index 4a1c5461..ad6883e9 100644 --- a/tests/configs/modules/weather/forecastweather_options.js +++ b/tests/configs/modules/weather/forecastweather_options.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -36,6 +24,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/modules/weather/forecastweather_units.js b/tests/configs/modules/weather/forecastweather_units.js index 6e3d0dfb..af5c8f09 100644 --- a/tests/configs/modules/weather/forecastweather_units.js +++ b/tests/configs/modules/weather/forecastweather_units.js @@ -4,19 +4,7 @@ * MIT Licensed. */ let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, units: "imperial", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -34,6 +22,8 @@ let config = { ] }; +config = Object.assign(require("../../default.js"), config); + /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; diff --git a/tests/configs/noIpWhiteList.js b/tests/configs/noIpWhiteList.js index cb578296..6fe8e888 100644 --- a/tests/configs/noIpWhiteList.js +++ b/tests/configs/noIpWhiteList.js @@ -3,23 +3,8 @@ * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["x.x.x.x"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - - modules: [] -}; +let config = require('./default.js'); +config.ipWhitelist = ["x.x.x.x"]; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/port_8090.js b/tests/configs/port_8090.js index e6813e5e..9771e40b 100644 --- a/tests/configs/port_8090.js +++ b/tests/configs/port_8090.js @@ -3,23 +3,8 @@ * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. */ -let config = { - port: 8090, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - - modules: [] -}; +let config = require('./default.js'); +config.port = 8090; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/without_modules.js b/tests/configs/without_modules.js index 46e721e5..d985a4f5 100644 --- a/tests/configs/without_modules.js +++ b/tests/configs/without_modules.js @@ -3,21 +3,8 @@ * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.10.1"], - - language: "en", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - } -}; +let config = require('./default.js'); +delete config.modules; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {