diff --git a/tests/e2e/dev_console.js b/tests/e2e/dev_console.js index 42530a38..42f8ac99 100644 --- a/tests/e2e/dev_console.js +++ b/tests/e2e/dev_console.js @@ -1,13 +1,8 @@ const helpers = require("./global-setup"); -const path = require("path"); -const request = require("request"); - const expect = require("chai").expect; const describe = global.describe; const it = global.it; -const beforeEach = global.beforeEach; -const afterEach = global.afterEach; describe("Development console tests", function() { // This tests fail and crash another tests diff --git a/tests/e2e/env_spec.js b/tests/e2e/env_spec.js index 4bcfc4e8..73784e96 100644 --- a/tests/e2e/env_spec.js +++ b/tests/e2e/env_spec.js @@ -1,7 +1,5 @@ const helpers = require("./global-setup"); -const path = require("path"); const request = require("request"); - const expect = require("chai").expect; const describe = global.describe; diff --git a/tests/e2e/fonts.js b/tests/e2e/fonts.js index 0303414b..9d7aa349 100644 --- a/tests/e2e/fonts.js +++ b/tests/e2e/fonts.js @@ -1,14 +1,9 @@ const helpers = require("./global-setup"); -const path = require("path"); const request = require("request"); - const expect = require("chai").expect; +const forEach = require("mocha-each"); const describe = global.describe; -const it = global.it; -const beforeEach = global.beforeEach; -const afterEach = global.afterEach; -const forEach = require("mocha-each"); describe("All font files from roboto.css should be downloadable", function() { helpers.setupTimeout(this); diff --git a/tests/e2e/global-setup.js b/tests/e2e/global-setup.js index 6bfe11d0..c4b170fe 100644 --- a/tests/e2e/global-setup.js +++ b/tests/e2e/global-setup.js @@ -12,7 +12,6 @@ const Application = require("spectron").Application; const assert = require("assert"); const chai = require("chai"); const chaiAsPromised = require("chai-as-promised"); - const path = require("path"); global.before(function() { diff --git a/tests/e2e/ipWhistlist_spec.js b/tests/e2e/ipWhistlist_spec.js index ef89aa24..e109e72d 100644 --- a/tests/e2e/ipWhistlist_spec.js +++ b/tests/e2e/ipWhistlist_spec.js @@ -1,7 +1,5 @@ const helpers = require("./global-setup"); -const path = require("path"); const request = require("request"); - const expect = require("chai").expect; const describe = global.describe; diff --git a/tests/e2e/modules/calendar_spec.js b/tests/e2e/modules/calendar_spec.js index e989cb17..1685f7f0 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -1,10 +1,6 @@ const helpers = require("../global-setup"); -const path = require("path"); -const request = require("request"); const serverBasicAuth = require("../../servers/basic-auth.js"); -const expect = require("chai").expect; - const describe = global.describe; const it = global.it; const beforeEach = global.beforeEach; diff --git a/tests/e2e/modules/clock_es_spec.js b/tests/e2e/modules/clock_es_spec.js index 455f3bed..7ad4ae64 100644 --- a/tests/e2e/modules/clock_es_spec.js +++ b/tests/e2e/modules/clock_es_spec.js @@ -1,8 +1,4 @@ const helpers = require("../global-setup"); -const path = require("path"); -const request = require("request"); - -const expect = require("chai").expect; const describe = global.describe; const it = global.it; @@ -86,5 +82,4 @@ describe("Clock set to spanish language module", function() { .getText(".clock .week").should.eventually.match(weekRegex); }); }); - }); diff --git a/tests/e2e/modules/clock_spec.js b/tests/e2e/modules/clock_spec.js index e342242c..be4ef0e3 100644 --- a/tests/e2e/modules/clock_spec.js +++ b/tests/e2e/modules/clock_spec.js @@ -1,8 +1,4 @@ const helpers = require("../global-setup"); -const path = require("path"); -const request = require("request"); - -const expect = require("chai").expect; const describe = global.describe; const it = global.it; diff --git a/tests/e2e/modules/compliments_spec.js b/tests/e2e/modules/compliments_spec.js index a840981e..35529b19 100644 --- a/tests/e2e/modules/compliments_spec.js +++ b/tests/e2e/modules/compliments_spec.js @@ -1,7 +1,4 @@ const helpers = require("../global-setup"); -const path = require("path"); -const request = require("request"); - const expect = require("chai").expect; const describe = global.describe; diff --git a/tests/e2e/modules/helloworld_spec.js b/tests/e2e/modules/helloworld_spec.js index 655594b0..a59e2ae4 100644 --- a/tests/e2e/modules/helloworld_spec.js +++ b/tests/e2e/modules/helloworld_spec.js @@ -1,8 +1,4 @@ const helpers = require("../global-setup"); -const path = require("path"); -const request = require("request"); - -const expect = require("chai").expect; const describe = global.describe; const it = global.it; @@ -24,7 +20,6 @@ describe("Test helloworld module", function() { }); }); - afterEach(function() { return helpers.stopApplication(app); }); @@ -52,5 +47,4 @@ describe("Test helloworld module", function() { .getText(".helloworld").should.eventually.equal("Hello World!"); }); }); - }); diff --git a/tests/e2e/modules/newsfeed_spec.js b/tests/e2e/modules/newsfeed_spec.js index e062121c..88cb8c3e 100644 --- a/tests/e2e/modules/newsfeed_spec.js +++ b/tests/e2e/modules/newsfeed_spec.js @@ -1,8 +1,4 @@ const helpers = require("../global-setup"); -const path = require("path"); -const request = require("request"); - -const expect = require("chai").expect; const describe = global.describe; const it = global.it; diff --git a/tests/e2e/modules_position_spec.js b/tests/e2e/modules_position_spec.js index a5f9e735..8bbcffae 100644 --- a/tests/e2e/modules_position_spec.js +++ b/tests/e2e/modules_position_spec.js @@ -1,13 +1,7 @@ const helpers = require("./global-setup"); -const path = require("path"); -const request = require("request"); - -const expect = require("chai").expect; const describe = global.describe; const it = global.it; -const beforeEach = global.beforeEach; -const afterEach = global.afterEach; describe("Position of modules", function () { helpers.setupTimeout(this); @@ -26,7 +20,6 @@ describe("Position of modules", function () { return helpers.startApplication({ args: ["js/electron.js"] }).then(function (startedApp) { app = startedApp; }) - }); var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", @@ -44,5 +37,4 @@ describe("Position of modules", function () { }); } }); - }); diff --git a/tests/e2e/port_config.js b/tests/e2e/port_config.js index c68aaca3..99bf04d0 100644 --- a/tests/e2e/port_config.js +++ b/tests/e2e/port_config.js @@ -1,7 +1,5 @@ const helpers = require("./global-setup"); -const path = require("path"); const request = require("request"); - const expect = require("chai").expect; const describe = global.describe; diff --git a/tests/e2e/vendor_spec.js b/tests/e2e/vendor_spec.js index 0d9751f1..91c92921 100644 --- a/tests/e2e/vendor_spec.js +++ b/tests/e2e/vendor_spec.js @@ -1,7 +1,5 @@ const helpers = require("./global-setup"); -const path = require("path"); const request = require("request"); - const expect = require("chai").expect; const describe = global.describe; diff --git a/tests/e2e/without_modules.js b/tests/e2e/without_modules.js index f3b5d920..39cce753 100644 --- a/tests/e2e/without_modules.js +++ b/tests/e2e/without_modules.js @@ -1,8 +1,4 @@ const helpers = require("./global-setup"); -const path = require("path"); -const request = require("request"); - -const expect = require("chai").expect; const describe = global.describe; const it = global.it; @@ -38,6 +34,5 @@ describe("Check configuration without modules", function () { return app.client.waitUntilWindowLoaded() .getText("#module_5_helloworld .module-content").should.eventually.equal("www.michaelteeuw.nl"); }); - }); diff --git a/tests/servers/basic-auth.js b/tests/servers/basic-auth.js index 15ce6caa..556412a8 100644 --- a/tests/servers/basic-auth.js +++ b/tests/servers/basic-auth.js @@ -1,4 +1,3 @@ -var http = require("http"); var path = require("path"); var auth = require("http-auth"); var express = require("express"); diff --git a/tests/unit/classes/class_spec.js b/tests/unit/classes/class_spec.js index d7a08121..29bcd8c2 100644 --- a/tests/unit/classes/class_spec.js +++ b/tests/unit/classes/class_spec.js @@ -1,5 +1,4 @@ -const chai = require("chai"); -const expect = chai.expect; +const expect = require("chai").expect; const path = require("path"); const {JSDOM} = require("jsdom"); diff --git a/tests/unit/classes/deprecated_spec.js b/tests/unit/classes/deprecated_spec.js index 3b57e84b..a11bba04 100644 --- a/tests/unit/classes/deprecated_spec.js +++ b/tests/unit/classes/deprecated_spec.js @@ -1,5 +1,4 @@ -const chai = require("chai"); -const expect = chai.expect; +const expect = require("chai").expect; const deprecated = require("../../../js/deprecated"); describe("Deprecated", function() { diff --git a/tests/unit/classes/translator_spec.js b/tests/unit/classes/translator_spec.js index fe1ce809..4186ba86 100644 --- a/tests/unit/classes/translator_spec.js +++ b/tests/unit/classes/translator_spec.js @@ -1,7 +1,5 @@ -const chai = require("chai"); -const expect = chai.expect; +const expect = require("chai").expect; const path = require("path"); -const fs = require("fs"); const helmet = require("helmet"); const {JSDOM} = require("jsdom"); const express = require("express"); diff --git a/tests/unit/classes/utils_spec.js b/tests/unit/classes/utils_spec.js index d833f555..bf5ea2f9 100644 --- a/tests/unit/classes/utils_spec.js +++ b/tests/unit/classes/utils_spec.js @@ -1,5 +1,4 @@ -var chai = require("chai"); -var expect = chai.expect; +var expect = require("chai").expect; var Utils = require("../../../js/utils.js"); var colors = require("colors/safe"); @@ -38,4 +37,3 @@ describe("Utils", function() { }); }); }); - diff --git a/tests/unit/functions/cmp_versions_spec.js b/tests/unit/functions/cmp_versions_spec.js index 2bd6d269..af543a08 100644 --- a/tests/unit/functions/cmp_versions_spec.js +++ b/tests/unit/functions/cmp_versions_spec.js @@ -1,5 +1,4 @@ -const chai = require("chai"); -const expect = chai.expect; +const expect = require("chai").expect; const path = require("path"); const {JSDOM} = require("jsdom"); @@ -29,4 +28,3 @@ describe("Test function cmpVersions in js/module.js", function() { expect(cmp("1.1", "1.0")).to.equal(1); }); }); - diff --git a/tests/unit/functions/currentweather_spec.js b/tests/unit/functions/currentweather_spec.js index d05df854..0afbbd7b 100644 --- a/tests/unit/functions/currentweather_spec.js +++ b/tests/unit/functions/currentweather_spec.js @@ -1,13 +1,7 @@ -var fs = require("fs"); -var path = require("path"); -var chai = require("chai"); -var expect = chai.expect; -var vm = require("vm"); - +var expect = require("chai").expect; describe("Functions module currentweather", function() { - // Fake for use by currentweather.js Module = {}; config = {}; @@ -16,7 +10,6 @@ describe("Functions module currentweather", function() { Module.definitions[name] = moduleDefinition; }; - before(function(){ require("../../../modules/default/currentweather/currentweather.js"); Module.definitions.currentweather.config = {}; @@ -48,7 +41,6 @@ describe("Functions module currentweather", function() { }); }); - describe("this.config.roundTemp is false", function() { before(function(){ diff --git a/tests/unit/functions/newsfeed_spec.js b/tests/unit/functions/newsfeed_spec.js index 42971f10..c6bb34f2 100644 --- a/tests/unit/functions/newsfeed_spec.js +++ b/tests/unit/functions/newsfeed_spec.js @@ -1,9 +1,4 @@ -var fs = require("fs"); -var path = require("path"); -var chai = require("chai"); -var expect = chai.expect; -var vm = require("vm"); - +var expect = require("chai").expect; describe("Functions into modules/default/newsfeed/newsfeed.js", function() { @@ -32,6 +27,5 @@ describe("Functions into modules/default/newsfeed/newsfeed.js", function() { }); }); }); - }); diff --git a/tests/unit/functions/weatherforecast_spec.js b/tests/unit/functions/weatherforecast_spec.js index 99fa4402..6c40531e 100644 --- a/tests/unit/functions/weatherforecast_spec.js +++ b/tests/unit/functions/weatherforecast_spec.js @@ -1,9 +1,4 @@ -var fs = require("fs"); -var path = require("path"); -var chai = require("chai"); -var expect = chai.expect; -var vm = require("vm"); - +var expect = require("chai").expect; describe("Functions module weatherforecast", function() { @@ -44,7 +39,6 @@ describe("Functions module weatherforecast", function() { }); }); - describe("this.config.roundTemp is false", function() { before(function(){ diff --git a/tests/unit/global_vars/defaults_modules_spec.js b/tests/unit/global_vars/defaults_modules_spec.js index 8df0d073..289a0296 100644 --- a/tests/unit/global_vars/defaults_modules_spec.js +++ b/tests/unit/global_vars/defaults_modules_spec.js @@ -1,7 +1,6 @@ var fs = require("fs"); var path = require("path"); -var chai = require("chai"); -var expect = chai.expect; +var expect = require("chai").expect; var vm = require("vm"); before(function() { @@ -62,5 +61,4 @@ describe("Default modules set in modules/default/defaultmodules.js", function() expect(fs.existsSync(path.join(this.sandbox.global.root_path, "modules/default", defaultModule))).to.equal(true); }); }); - }); diff --git a/tests/unit/global_vars/root_path_spec.js b/tests/unit/global_vars/root_path_spec.js index ef7ce3e9..f5469e80 100644 --- a/tests/unit/global_vars/root_path_spec.js +++ b/tests/unit/global_vars/root_path_spec.js @@ -1,7 +1,6 @@ var fs = require("fs"); var path = require("path"); -var chai = require("chai"); -var expect = chai.expect; +var expect = require("chai").expect; var vm = require("vm"); before(function() { @@ -66,6 +65,4 @@ describe("'global.root_path' set in js/app.js", function() { versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version; expect(this.sandbox.global.version).to.equal(versionPackage); }); - }); -