diff --git a/CHANGELOG.md b/CHANGELOG.md index b2967241..6ebe571f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ _This release is scheduled to be released on 2021-10-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..e3236318 --- /dev/null +++ b/tests/configs/default.js @@ -0,0 +1,27 @@ +/* Magic Mirror Test default config for modules + * + * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com + * MIT Licensed. + */ +exports.configFactory = function (options) { + return Object.assign( + { + 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: [] + }, + options + ); +}; diff --git a/tests/configs/empty_ipWhiteList.js b/tests/configs/empty_ipWhiteList.js index 4b0d4057..cdf637c5 100644 --- a/tests/configs/empty_ipWhiteList.js +++ b/tests/configs/empty_ipWhiteList.js @@ -3,23 +3,9 @@ * 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(process.cwd() + "/tests/configs/default.js").configFactory({ + 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..a2d81f67 100644 --- a/tests/configs/env.js +++ b/tests/configs/env.js @@ -3,23 +3,7 @@ * 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(process.cwd() + "/tests/configs/default.js").configFactory(); /*************** 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..b75a41f8 100644 --- a/tests/configs/modules/alert/default.js +++ b/tests/configs/modules/alert/default.js @@ -3,21 +3,7 @@ * By rejas * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "alert", @@ -27,7 +13,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/auth-default.js b/tests/configs/modules/calendar/auth-default.js index 8eabfe21..8375bfcd 100644 --- a/tests/configs/modules/calendar/auth-default.js +++ b/tests/configs/modules/calendar/auth-default.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -36,7 +24,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/basic-auth.js b/tests/configs/modules/calendar/basic-auth.js index 342da0e2..a1150281 100644 --- a/tests/configs/modules/calendar/basic-auth.js +++ b/tests/configs/modules/calendar/basic-auth.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -37,7 +25,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/changed-port.js b/tests/configs/modules/calendar/changed-port.js index ef59aea9..e43feafa 100644 --- a/tests/configs/modules/calendar/changed-port.js +++ b/tests/configs/modules/calendar/changed-port.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -36,7 +24,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/custom.js b/tests/configs/modules/calendar/custom.js index 721c0990..16f82ea0 100644 --- a/tests/configs/modules/calendar/custom.js +++ b/tests/configs/modules/calendar/custom.js @@ -3,20 +3,8 @@ * By Rejas * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -36,7 +24,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/default.js b/tests/configs/modules/calendar/default.js index ccb37af8..5964b294 100644 --- a/tests/configs/modules/calendar/default.js +++ b/tests/configs/modules/calendar/default.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -32,7 +20,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/fail-basic-auth.js b/tests/configs/modules/calendar/fail-basic-auth.js index 0ab1bdde..54d04064 100644 --- a/tests/configs/modules/calendar/fail-basic-auth.js +++ b/tests/configs/modules/calendar/fail-basic-auth.js @@ -5,20 +5,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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -39,7 +27,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/old-basic-auth.js b/tests/configs/modules/calendar/old-basic-auth.js index 519acc9b..06570eb1 100644 --- a/tests/configs/modules/calendar/old-basic-auth.js +++ b/tests/configs/modules/calendar/old-basic-auth.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -34,7 +22,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/calendar/recurring.js b/tests/configs/modules/calendar/recurring.js index a085ad07..879b966e 100644 --- a/tests/configs/modules/calendar/recurring.js +++ b/tests/configs/modules/calendar/recurring.js @@ -3,20 +3,8 @@ * By Rejas * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,7 +21,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/clock_12hr.js b/tests/configs/modules/clock/clock_12hr.js index 9de222ed..35b45914 100644 --- a/tests/configs/modules/clock/clock_12hr.js +++ b/tests/configs/modules/clock/clock_12hr.js @@ -3,20 +3,8 @@ * By Sergey Morozov * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -24,7 +12,7 @@ let config = { position: "middle_center" } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/clock_24hr.js b/tests/configs/modules/clock/clock_24hr.js index e5ec59e3..01b2a36b 100644 --- a/tests/configs/modules/clock/clock_24hr.js +++ b/tests/configs/modules/clock/clock_24hr.js @@ -3,28 +3,14 @@ * By Sergey Morozov * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "clock", position: "middle_center" } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/clock_analog.js b/tests/configs/modules/clock/clock_analog.js index c76c10eb..b33bd051 100644 --- a/tests/configs/modules/clock/clock_analog.js +++ b/tests/configs/modules/clock/clock_analog.js @@ -2,21 +2,7 @@ * * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "clock", @@ -27,7 +13,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/clock_displaySeconds_false.js b/tests/configs/modules/clock/clock_displaySeconds_false.js index e74019d3..1caef7e3 100644 --- a/tests/configs/modules/clock/clock_displaySeconds_false.js +++ b/tests/configs/modules/clock/clock_displaySeconds_false.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -27,7 +15,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/clock_showPeriodUpper.js b/tests/configs/modules/clock/clock_showPeriodUpper.js index 6819de54..b069c438 100644 --- a/tests/configs/modules/clock/clock_showPeriodUpper.js +++ b/tests/configs/modules/clock/clock_showPeriodUpper.js @@ -3,20 +3,8 @@ * By Sergey Morozov * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -27,7 +15,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/clock_showWeek.js b/tests/configs/modules/clock/clock_showWeek.js index 26b16194..b595ba70 100644 --- a/tests/configs/modules/clock/clock_showWeek.js +++ b/tests/configs/modules/clock/clock_showWeek.js @@ -3,20 +3,8 @@ * By Johan Hammar * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -27,7 +15,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/es/clock_12hr.js b/tests/configs/modules/clock/es/clock_12hr.js index ed9d390d..addbeb9f 100644 --- a/tests/configs/modules/clock/es/clock_12hr.js +++ b/tests/configs/modules/clock/es/clock_12hr.js @@ -3,20 +3,9 @@ * 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"], - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ language: "es", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -24,7 +13,7 @@ let config = { position: "middle_center" } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/es/clock_24hr.js b/tests/configs/modules/clock/es/clock_24hr.js index 985d579c..a5fe49ca 100644 --- a/tests/configs/modules/clock/es/clock_24hr.js +++ b/tests/configs/modules/clock/es/clock_24hr.js @@ -3,20 +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"], - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ language: "es", - timeFormat: 24, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -24,7 +12,7 @@ let config = { position: "middle_center" } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/es/clock_showPeriodUpper.js b/tests/configs/modules/clock/es/clock_showPeriodUpper.js index 29c02155..4a5ab636 100644 --- a/tests/configs/modules/clock/es/clock_showPeriodUpper.js +++ b/tests/configs/modules/clock/es/clock_showPeriodUpper.js @@ -3,20 +3,9 @@ * 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"], - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ language: "es", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -27,7 +16,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/clock/es/clock_showWeek.js b/tests/configs/modules/clock/es/clock_showWeek.js index 95803d5a..b4a436a6 100644 --- a/tests/configs/modules/clock/es/clock_showWeek.js +++ b/tests/configs/modules/clock/es/clock_showWeek.js @@ -4,20 +4,9 @@ * 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"], - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ language: "es", timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -28,7 +17,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/compliments/compliments_anytime.js b/tests/configs/modules/compliments/compliments_anytime.js index 8cc0fc07..f6731edf 100644 --- a/tests/configs/modules/compliments/compliments_anytime.js +++ b/tests/configs/modules/compliments/compliments_anytime.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -32,7 +20,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/compliments/compliments_date.js b/tests/configs/modules/compliments/compliments_date.js index 8403d10c..c9549816 100644 --- a/tests/configs/modules/compliments/compliments_date.js +++ b/tests/configs/modules/compliments/compliments_date.js @@ -3,20 +3,8 @@ * By Rejas * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,7 +21,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/compliments/compliments_only_anytime.js b/tests/configs/modules/compliments/compliments_only_anytime.js index 758ac9b2..d65bc67d 100644 --- a/tests/configs/modules/compliments/compliments_only_anytime.js +++ b/tests/configs/modules/compliments/compliments_only_anytime.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -29,7 +17,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/compliments/compliments_parts_day.js b/tests/configs/modules/compliments/compliments_parts_day.js index 51d5ea89..e490a710 100644 --- a/tests/configs/modules/compliments/compliments_parts_day.js +++ b/tests/configs/modules/compliments/compliments_parts_day.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -31,7 +19,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/display.js b/tests/configs/modules/display.js index aae06520..070dc9e5 100644 --- a/tests/configs/modules/display.js +++ b/tests/configs/modules/display.js @@ -3,24 +3,7 @@ * By Rejas * 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, - height: 600, - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "helloworld", @@ -38,7 +21,11 @@ let config = { } } ] -}; +}); + +config.electronOptions.fullscreen = false; +config.electronOptions.width = 800; +config.electronOptions.height = 600; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/helloworld/helloworld.js b/tests/configs/modules/helloworld/helloworld.js index 3f83a0f9..9845e4b8 100644 --- a/tests/configs/modules/helloworld/helloworld.js +++ b/tests/configs/modules/helloworld/helloworld.js @@ -3,21 +3,7 @@ * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "helloworld", @@ -27,7 +13,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/helloworld/helloworld_default.js b/tests/configs/modules/helloworld/helloworld_default.js index a0a9a29e..6400c9f7 100644 --- a/tests/configs/modules/helloworld/helloworld_default.js +++ b/tests/configs/modules/helloworld/helloworld_default.js @@ -3,28 +3,14 @@ * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "helloworld", position: "bottom_bar" } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/newsfeed/default.js b/tests/configs/modules/newsfeed/default.js index 59cf7d02..1a112566 100644 --- a/tests/configs/modules/newsfeed/default.js +++ b/tests/configs/modules/newsfeed/default.js @@ -3,20 +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", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -32,7 +20,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/newsfeed/incorrect_url.js b/tests/configs/modules/newsfeed/incorrect_url.js index afb093e0..ab126aa4 100644 --- a/tests/configs/modules/newsfeed/incorrect_url.js +++ b/tests/configs/modules/newsfeed/incorrect_url.js @@ -2,20 +2,8 @@ * * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -31,7 +19,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/newsfeed/prohibited_words.js b/tests/configs/modules/newsfeed/prohibited_words.js index a21dd475..f4040557 100644 --- a/tests/configs/modules/newsfeed/prohibited_words.js +++ b/tests/configs/modules/newsfeed/prohibited_words.js @@ -2,20 +2,8 @@ * * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -33,7 +21,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/positions.js b/tests/configs/modules/positions.js index a69b26fd..479775c8 100644 --- a/tests/configs/modules/positions.js +++ b/tests/configs/modules/positions.js @@ -3,21 +3,7 @@ * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: // Using exotic content. This is why don't accept go to JSON configuration file (function () { @@ -34,7 +20,7 @@ let config = { } return modules; })() -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/currentweather_compliments.js b/tests/configs/modules/weather/currentweather_compliments.js index 257c92cf..35d5ffb5 100644 --- a/tests/configs/modules/weather/currentweather_compliments.js +++ b/tests/configs/modules/weather/currentweather_compliments.js @@ -3,22 +3,7 @@ * By rejas https://github.com/rejas * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "compliments", @@ -40,7 +25,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/currentweather_default.js b/tests/configs/modules/weather/currentweather_default.js index 0cdac111..5c7edd5c 100644 --- a/tests/configs/modules/weather/currentweather_default.js +++ b/tests/configs/modules/weather/currentweather_default.js @@ -3,20 +3,8 @@ * By fewieden https://github.com/fewieden * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -29,7 +17,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/currentweather_options.js b/tests/configs/modules/weather/currentweather_options.js index 568c7006..f3ff9d5d 100644 --- a/tests/configs/modules/weather/currentweather_options.js +++ b/tests/configs/modules/weather/currentweather_options.js @@ -3,21 +3,7 @@ * By fewieden https://github.com/fewieden * 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 - } - }, - +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ modules: [ { module: "weather", @@ -35,7 +21,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/currentweather_units.js b/tests/configs/modules/weather/currentweather_units.js index 4c18a5eb..af73d058 100644 --- a/tests/configs/modules/weather/currentweather_units.js +++ b/tests/configs/modules/weather/currentweather_units.js @@ -3,20 +3,8 @@ * By fewieden https://github.com/fewieden * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ units: "imperial", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -31,7 +19,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/forecastweather_default.js b/tests/configs/modules/weather/forecastweather_default.js index fc374c3b..f4b401f6 100644 --- a/tests/configs/modules/weather/forecastweather_default.js +++ b/tests/configs/modules/weather/forecastweather_default.js @@ -3,20 +3,8 @@ * By fewieden https://github.com/fewieden * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -31,7 +19,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/forecastweather_options.js b/tests/configs/modules/weather/forecastweather_options.js index 4a1c5461..094d9a00 100644 --- a/tests/configs/modules/weather/forecastweather_options.js +++ b/tests/configs/modules/weather/forecastweather_options.js @@ -3,20 +3,8 @@ * By fewieden https://github.com/fewieden * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ timeFormat: 12, - units: "metric", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -34,7 +22,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/modules/weather/forecastweather_units.js b/tests/configs/modules/weather/forecastweather_units.js index 6e3d0dfb..843f874b 100644 --- a/tests/configs/modules/weather/forecastweather_units.js +++ b/tests/configs/modules/weather/forecastweather_units.js @@ -3,20 +3,8 @@ * By rejas * MIT Licensed. */ -let config = { - port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - - language: "en", - timeFormat: 24, +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ units: "imperial", - electronOptions: { - webPreferences: { - nodeIntegration: true, - enableRemoteModule: true, - contextIsolation: false - } - }, modules: [ { @@ -32,7 +20,7 @@ let config = { } } ] -}; +}); /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { diff --git a/tests/configs/noIpWhiteList.js b/tests/configs/noIpWhiteList.js index cb578296..40655480 100644 --- a/tests/configs/noIpWhiteList.js +++ b/tests/configs/noIpWhiteList.js @@ -3,23 +3,9 @@ * 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(process.cwd() + "/tests/configs/default.js").configFactory({ + 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..7756fb76 100644 --- a/tests/configs/port_8090.js +++ b/tests/configs/port_8090.js @@ -3,23 +3,9 @@ * 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(process.cwd() + "/tests/configs/default.js").configFactory({ + 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..02b767c0 100644 --- a/tests/configs/without_modules.js +++ b/tests/configs/without_modules.js @@ -3,21 +3,10 @@ * 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(process.cwd() + "/tests/configs/default.js").configFactory({ + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.10.1"] +}); +delete config.modules; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {