Cleanup test directory (#2937)

Moves files around and renames some so that the structure is cleaner and
more consistent
This commit is contained in:
Veeck
2022-10-07 19:16:37 +02:00
committed by GitHub
parent 21ae79b386
commit a328ce537f
48 changed files with 739 additions and 825 deletions

View File

@@ -0,0 +1,29 @@
const path = require("path");
const auth = require("express-basic-auth");
const express = require("express");
const app = express();
const basicAuth = auth({
realm: "MagicMirror² Area restricted.",
users: { MagicMirror: "CallMeADog" }
});
app.use(basicAuth);
// Set available directories
const directories = ["/tests/configs", "/tests/mocks"];
const rootPath = path.resolve(__dirname + "/../../../");
for (let directory of directories) {
app.use(directory, express.static(path.resolve(rootPath + directory)));
}
let server;
exports.listen = (...args) => {
server = app.listen.apply(app, args);
};
exports.close = async () => {
await server.close();
};