Fix some eslint issues in the tests

This commit is contained in:
rejas 2021-07-01 16:37:27 +02:00 committed by veeck
parent bcff953fbb
commit 53720ae8ae
4 changed files with 72 additions and 68 deletions

View File

@ -5,7 +5,7 @@ describe("Clock set to spanish language module", function () {
let app = null; let app = null;
testMatch = async function (element, regex) { const testMatch = async function (element, regex) {
await app.client.waitUntilWindowLoaded(); await app.client.waitUntilWindowLoaded();
const elem = await app.client.$(element); const elem = await app.client.$(element);
const txt = await elem.getText(element); const txt = await elem.getText(element);

View File

@ -6,7 +6,7 @@ describe("Clock module", function () {
let app = null; let app = null;
testMatch = async function (element, regex) { const testMatch = async function (element, regex) {
await app.client.waitUntilWindowLoaded(); await app.client.waitUntilWindowLoaded();
const elem = await app.client.$(element); const elem = await app.client.$(element);
const txt = await elem.getText(element); const txt = await elem.getText(element);

View File

@ -4,6 +4,9 @@ const vm = require("vm");
const basedir = path.join(__dirname, "../../.."); const basedir = path.join(__dirname, "../../..");
describe("Default modules set in modules/default/defaultmodules.js", function () {
let sandbox = null;
beforeAll(function () { beforeAll(function () {
const fileName = "js/app.js"; const fileName = "js/app.js";
const filePath = path.join(basedir, fileName); const filePath = path.join(basedir, fileName);
@ -27,7 +30,7 @@ beforeAll(function () {
} else { } else {
try { try {
return require(filename); return require(filename);
} catch { } catch (ignore) {
// ignore // ignore
} }
} }
@ -36,7 +39,6 @@ beforeAll(function () {
vm.runInNewContext(code, sandbox, fileName); vm.runInNewContext(code, sandbox, fileName);
}); });
describe("Default modules set in modules/default/defaultmodules.js", function () {
const expectedDefaultModules = require("../../../modules/default/defaultmodules"); const expectedDefaultModules = require("../../../modules/default/defaultmodules");
for (const defaultModule of expectedDefaultModules) { for (const defaultModule of expectedDefaultModules) {

View File

@ -2,6 +2,9 @@ const fs = require("fs");
const path = require("path"); const path = require("path");
const vm = require("vm"); const vm = require("vm");
describe("'global.root_path' set in js/app.js", function () {
let sandbox = null;
beforeAll(function () { beforeAll(function () {
const basedir = path.join(__dirname, "../../.."); const basedir = path.join(__dirname, "../../..");
@ -27,7 +30,7 @@ beforeAll(function () {
} else { } else {
try { try {
return require(filename); return require(filename);
} catch { } catch (ignore) {
// ignore // ignore
} }
} }
@ -36,7 +39,6 @@ beforeAll(function () {
vm.runInNewContext(code, sandbox, fileName); vm.runInNewContext(code, sandbox, fileName);
}); });
describe("'global.root_path' set in js/app.js", function () {
const expectedSubPaths = ["modules", "serveronly", "js", "js/app.js", "js/main.js", "js/electron.js", "config"]; const expectedSubPaths = ["modules", "serveronly", "js", "js/app.js", "js/main.js", "js/electron.js", "config"];
expectedSubPaths.forEach((subpath) => { expectedSubPaths.forEach((subpath) => {