mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-09-13 23:55:11 +00:00
Merge branch 'develop' into feature/automated-weather-tests
# Conflicts: # modules/default/weather/weather.js # package-lock.json # package.json
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
@@ -18,7 +13,7 @@ describe("All font files from roboto.css should be downloadable", function() {
|
||||
var fileContent = require("fs").readFileSync(__dirname + "/../../fonts/roboto.css", "utf8");
|
||||
var regex = /\burl\(['"]([^'"]+)['"]\)/g;
|
||||
var match = regex.exec(fileContent);
|
||||
while (match != null) {
|
||||
while (match !== null) {
|
||||
// Push 1st match group onto fontFiles stack
|
||||
fontFiles.push(match[1]);
|
||||
// Find the next one
|
||||
|
@@ -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() {
|
||||
|
@@ -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;
|
||||
@@ -17,7 +15,7 @@ describe("ipWhitelist directive configuration", function () {
|
||||
beforeEach(function () {
|
||||
return helpers.startApplication({
|
||||
args: ["js/electron.js"]
|
||||
}).then(function (startedApp) { app = startedApp; })
|
||||
}).then(function (startedApp) { app = startedApp; });
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
|
@@ -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;
|
||||
@@ -72,7 +68,7 @@ describe("Calendar module", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Basic auth backward compatibilty configuration: DEPRECATED", function() {
|
||||
describe("Basic auth backward compatibility configuration: DEPRECATED", function() {
|
||||
before(function() {
|
||||
serverBasicAuth.listen(8012);
|
||||
// Set config sample for use in test
|
||||
|
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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!");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
@@ -25,8 +19,7 @@ describe("Position of modules", function () {
|
||||
process.env.MM_CONFIG_FILE = "tests/configs/modules/positions.js";
|
||||
return helpers.startApplication({
|
||||
args: ["js/electron.js"]
|
||||
}).then(function (startedApp) { app = startedApp; })
|
||||
|
||||
}).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 () {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -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;
|
||||
@@ -17,7 +15,7 @@ describe("port directive configuration", function () {
|
||||
beforeEach(function () {
|
||||
return helpers.startApplication({
|
||||
args: ["js/electron.js"]
|
||||
}).then(function (startedApp) { app = startedApp; })
|
||||
}).then(function (startedApp) { app = startedApp; });
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
@@ -38,7 +36,7 @@ describe("port directive configuration", function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Set port 8100 on enviroment variable MM_PORT", function () {
|
||||
describe("Set port 8100 on environment variable MM_PORT", function () {
|
||||
before(function () {
|
||||
process.env.MM_PORT = 8100;
|
||||
// Set config sample for use in this test
|
||||
@@ -56,5 +54,4 @@ describe("port directive configuration", function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -121,8 +121,7 @@ describe("Translations", function() {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -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;
|
||||
@@ -11,7 +9,6 @@ const after = global.after;
|
||||
|
||||
describe("Vendors", function () {
|
||||
|
||||
return; // Test still getting failed in Travis
|
||||
|
||||
helpers.setupTimeout(this);
|
||||
|
||||
@@ -20,7 +17,7 @@ describe("Vendors", function () {
|
||||
before(function () {
|
||||
return helpers.startApplication({
|
||||
args: ["js/electron.js"]
|
||||
}).then(function (startedApp) { app = startedApp; })
|
||||
}).then(function (startedApp) { app = startedApp; });
|
||||
});
|
||||
|
||||
after(function () {
|
||||
@@ -42,5 +39,14 @@ describe("Vendors", function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Object.keys(vendors).forEach(vendor => {
|
||||
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, function() {
|
||||
urlVendor = "http://localhost:8080/" + vendors[vendor];
|
||||
request.get(urlVendor, function (err, res, body) {
|
||||
expect(res.statusCode).to.equal(404);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -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;
|
||||
@@ -17,7 +13,7 @@ describe("Check configuration without modules", function () {
|
||||
beforeEach(function () {
|
||||
return helpers.startApplication({
|
||||
args: ["js/electron.js"]
|
||||
}).then(function (startedApp) { app = startedApp; })
|
||||
}).then(function (startedApp) { app = startedApp; });
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
@@ -31,13 +27,12 @@ describe("Check configuration without modules", function () {
|
||||
|
||||
it("Show the message MagicMirror title", function () {
|
||||
return app.client.waitUntilWindowLoaded()
|
||||
.getText("#module_1_helloworld .module-content").should.eventually.equal("Magic Mirror2")
|
||||
.getText("#module_1_helloworld .module-content").should.eventually.equal("Magic Mirror2");
|
||||
});
|
||||
|
||||
it("Show the text Michael's website", function () {
|
||||
return app.client.waitUntilWindowLoaded()
|
||||
.getText("#module_5_helloworld .module-content").should.eventually.equal("www.michaelteeuw.nl");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user