fix test path and eslint

This commit is contained in:
Felix Wiedenbach 2019-09-11 15:58:51 +02:00
parent 55eb6e2e5c
commit aad03a74c5
6 changed files with 491 additions and 714 deletions

View File

@ -17,6 +17,7 @@
}, },
"parserOptions": { "parserOptions": {
"sourceType": "module", "sourceType": "module",
"ecmaVersion": 2017,
"ecmaFeatures": { "ecmaFeatures": {
"globalReturn": true "globalReturn": true
} }

1083
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@ const expect = require("chai").expect;
const fs = require("fs"); const fs = require("fs");
const _ = require("lodash"); const _ = require("lodash");
const moment = require("moment"); const moment = require("moment");
const path = require("path");
const wdajaxstub = require("webdriverajaxstub"); const wdajaxstub = require("webdriverajaxstub");
const helpers = require("../global-setup"); const helpers = require("../global-setup");
@ -80,7 +81,7 @@ describe("Weather module", function() {
let template; let template;
before(function() { before(function() {
template = fs.readFileSync(__dirname + '../../../../modules/default/weather/current.njk', 'utf8'); template = fs.readFileSync(path.join(__dirname, "..", "..", "..", "modules", "default", "weather", "current.njk"), "utf8");
}); });
describe("Default configuration", function() { describe("Default configuration", function() {
@ -92,32 +93,31 @@ describe("Weather module", function() {
const weather = generateWeather(); const weather = generateWeather();
await setup([weather, template]); await setup([weather, template]);
return app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(2)', '6 WSW', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(2)", "6 WSW", 10000);
}); });
it("should render sunrise", async function() { it("should render sunrise", async function() {
const sunrise = moment().startOf('day').unix(); const sunrise = moment().startOf("day").unix();
const sunset = moment().startOf('day').unix(); const sunset = moment().startOf("day").unix();
const weather = generateWeather({sys: {sunrise, sunset}}); const weather = generateWeather({sys: {sunrise, sunset}});
await setup([weather, template]); await setup([weather, template]);
await app.client.waitForExist(".weather .normal.medium span.wi.dimmed.wi-sunrise", 10000); await app.client.waitForExist(".weather .normal.medium span.wi.dimmed.wi-sunrise", 10000);
return app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(4)', '12:00 am', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(4)", "12:00 am", 10000);
}); });
it("should render sunset", async function() { it("should render sunset", async function() {
const sunrise = moment().startOf('day').unix(); const sunrise = moment().startOf("day").unix();
const sunset = moment().endOf('day').unix(); const sunset = moment().endOf("day").unix();
const weather = generateWeather({sys: {sunrise, sunset}}); const weather = generateWeather({sys: {sunrise, sunset}});
await setup([weather, template]); await setup([weather, template]);
await app.client.waitForExist(".weather .normal.medium span.wi.dimmed.wi-sunset", 10000); await app.client.waitForExist(".weather .normal.medium span.wi.dimmed.wi-sunset", 10000);
return app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(4)', '11:59 pm', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(4)", "11:59 pm", 10000);
}); });
it("should render temperature with icon", async function() { it("should render temperature with icon", async function() {
@ -126,14 +126,14 @@ describe("Weather module", function() {
await app.client.waitForExist(".weather .large.light span.wi.weathericon.wi-snow", 10000); await app.client.waitForExist(".weather .large.light span.wi.weathericon.wi-snow", 10000);
return app.client.waitUntilTextExists('.weather .large.light span.bright', '1.5°', 10000); return app.client.waitUntilTextExists(".weather .large.light span.bright", "1.5°", 10000);
}); });
it("should render feels like temperature", async function() { it("should render feels like temperature", async function() {
const weather = generateWeather(); const weather = generateWeather();
await setup([weather, template]); await setup([weather, template]);
return app.client.waitUntilTextExists('.weather .normal.medium span.dimmed', 'Feels like -5.6°', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span.dimmed", "Feels like -5.6°", 10000);
}); });
}); });
@ -148,15 +148,15 @@ describe("Weather module", function() {
const weather = generateWeather(); const weather = generateWeather();
await setup([weather, template]); await setup([weather, template]);
return app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(2)', '12', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(2)", "12", 10000);
}); });
it("should render showWindDirectionAsArrow = true", async function() { it("should render showWindDirectionAsArrow = true", async function() {
const weather = generateWeather(); const weather = generateWeather();
await setup([weather, template]); await setup([weather, template]);
await app.client.waitForExist('.weather .normal.medium sup i.fa-long-arrow-up', 10000); await app.client.waitForExist(".weather .normal.medium sup i.fa-long-arrow-up", 10000);
const element = await app.client.getHTML('.weather .normal.medium sup i.fa-long-arrow-up'); const element = await app.client.getHTML(".weather .normal.medium sup i.fa-long-arrow-up");
expect(element).to.include("transform:rotate(250deg);"); expect(element).to.include("transform:rotate(250deg);");
}); });
@ -165,17 +165,17 @@ describe("Weather module", function() {
const weather = generateWeather(); const weather = generateWeather();
await setup([weather, template]); await setup([weather, template]);
await app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(3)', '93', 10000); await app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(3)", "93", 10000);
return app.client.waitForExist('.weather .normal.medium sup i.wi-humidity', 10000); return app.client.waitForExist(".weather .normal.medium sup i.wi-humidity", 10000);
}); });
it("should render degreeLabel = true", async function() { it("should render degreeLabel = true", async function() {
const weather = generateWeather(); const weather = generateWeather();
await setup([weather, template]); await setup([weather, template]);
await app.client.waitUntilTextExists('.weather .large.light span.bright', '1°C', 10000); await app.client.waitUntilTextExists(".weather .large.light span.bright", "1°C", 10000);
return app.client.waitUntilTextExists('.weather .normal.medium span.dimmed', 'Feels like -6°C', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span.dimmed", "Feels like -6°C", 10000);
}); });
}); });
@ -197,9 +197,9 @@ describe("Weather module", function() {
}); });
await setup([weather, template]); await setup([weather, template]);
await app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(2)', '6 WSW', 10000); await app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(2)", "6 WSW", 10000);
await app.client.waitUntilTextExists('.weather .large.light span.bright', '34,7°', 10000); await app.client.waitUntilTextExists(".weather .large.light span.bright", "34,7°", 10000);
return app.client.waitUntilTextExists('.weather .normal.medium span.dimmed', '22,0°', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span.dimmed", "22,0°", 10000);
}); });
it("should render decimalSymbol = ','", async function() { it("should render decimalSymbol = ','", async function() {
@ -215,9 +215,9 @@ describe("Weather module", function() {
}); });
await setup([weather, template]); await setup([weather, template]);
await app.client.waitUntilTextExists('.weather .normal.medium span:nth-child(3)', '93,7', 10000); await app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(3)", "93,7", 10000);
await app.client.waitUntilTextExists('.weather .large.light span.bright', '34,7°', 10000); await app.client.waitUntilTextExists(".weather .large.light span.bright", "34,7°", 10000);
return app.client.waitUntilTextExists('.weather .normal.medium span.dimmed', '22,0°', 10000); return app.client.waitUntilTextExists(".weather .normal.medium span.dimmed", "22,0°", 10000);
}); });
}); });
}); });

View File

@ -9,7 +9,6 @@ const after = global.after;
describe("Vendors", function () { describe("Vendors", function () {
helpers.setupTimeout(this); helpers.setupTimeout(this);
var app = null; var app = null;

View File

@ -1,6 +1,6 @@
function plugin (wdInstance, requests) { function plugin (wdInstance, requests) {
if (typeof wdInstance.addCommand !== 'function') { if (typeof wdInstance.addCommand !== "function") {
throw new Error('You can\'t use WebdriverAjaxStub with this version of WebdriverIO'); throw new Error("You can't use WebdriverAjaxStub with this version of WebdriverIO");
} }
function stub(requests, done) { function stub(requests, done) {
@ -25,7 +25,7 @@ function plugin (wdInstance, requests) {
done(); done();
} }
wdInstance.addCommand('setupStub', function() { wdInstance.addCommand("setupStub", function() {
return wdInstance.executeAsync(stub, requests); return wdInstance.executeAsync(stub, requests);
}); });
} }

66
vendor/package-lock.json generated vendored
View File

@ -225,7 +225,8 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -243,11 +244,13 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true "bundled": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -260,15 +263,18 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -371,7 +377,8 @@
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true "bundled": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -381,6 +388,7 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -393,17 +401,20 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true "bundled": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -420,6 +431,7 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -492,7 +504,8 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -502,6 +515,7 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -577,7 +591,8 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -607,6 +622,7 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -624,6 +640,7 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -662,11 +679,13 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true "bundled": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true "bundled": true,
"optional": true
} }
} }
}, },
@ -684,6 +703,7 @@
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
"integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
"optional": true,
"requires": { "requires": {
"is-glob": "^2.0.0" "is-glob": "^2.0.0"
} }
@ -697,7 +717,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"optional": true
}, },
"invert-kv": { "invert-kv": {
"version": "1.0.0", "version": "1.0.0",
@ -716,7 +737,8 @@
"is-buffer": { "is-buffer": {
"version": "1.1.5", "version": "1.1.5",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
"integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
"optional": true
}, },
"is-dotfile": { "is-dotfile": {
"version": "1.0.3", "version": "1.0.3",
@ -742,7 +764,8 @@
"is-extglob": { "is-extglob": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
"optional": true
}, },
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
@ -756,6 +779,7 @@
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
"optional": true,
"requires": { "requires": {
"is-extglob": "^1.0.0" "is-extglob": "^1.0.0"
} }
@ -784,7 +808,8 @@
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"optional": true
}, },
"isobject": { "isobject": {
"version": "2.1.0", "version": "2.1.0",
@ -799,6 +824,7 @@
"version": "3.2.2", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"optional": true,
"requires": { "requires": {
"is-buffer": "^1.1.5" "is-buffer": "^1.1.5"
} }
@ -864,6 +890,7 @@
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
"integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
"optional": true,
"requires": { "requires": {
"remove-trailing-separator": "^1.0.1" "remove-trailing-separator": "^1.0.1"
} }
@ -1012,12 +1039,14 @@
"remove-trailing-separator": { "remove-trailing-separator": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
"integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
"optional": true
}, },
"repeat-element": { "repeat-element": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
"integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=",
"optional": true
}, },
"repeat-string": { "repeat-string": {
"version": "1.6.1", "version": "1.6.1",
@ -1028,7 +1057,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"optional": true
}, },
"set-immediate-shim": { "set-immediate-shim": {
"version": "1.0.1", "version": "1.0.1",