mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Change suggestion for e2e testing
- Changed global-setup.js to allow for easier test creation - Changed each e2e test suite to work with new global-setup.js - All tests (except for dev_console.js) now work with Travis CI
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
var http = require("http");
|
||||
var path = require("path");
|
||||
var auth = require("http-auth");
|
||||
var express = require("express")
|
||||
var express = require("express");
|
||||
var app = express();
|
||||
|
||||
var basic = auth.basic({
|
||||
realm: "MagicMirror Area restricted."
|
||||
}, (username, password, callback) => {
|
||||
callback(username === "MagicMirror" && password === "CallMeADog");
|
||||
});
|
||||
var server;
|
||||
|
||||
this.server = express();
|
||||
this.server.use(auth.connect(basic));
|
||||
var basic = auth.basic(
|
||||
{
|
||||
realm: "MagicMirror Area restricted."
|
||||
},
|
||||
(username, password, callback) => {
|
||||
callback(username === "MagicMirror" && password === "CallMeADog");
|
||||
}
|
||||
);
|
||||
|
||||
app.use(auth.connect(basic));
|
||||
|
||||
// Set directories availables
|
||||
var directories = ["/tests/configs"];
|
||||
@@ -18,13 +23,13 @@ var directory;
|
||||
rootPath = path.resolve(__dirname + "/../../");
|
||||
for (i in directories) {
|
||||
directory = directories[i];
|
||||
this.server.use(directory, express.static(path.resolve(rootPath + directory)));
|
||||
app.use(directory, express.static(path.resolve(rootPath + directory)));
|
||||
}
|
||||
|
||||
exports.listen = function () {
|
||||
this.server.listen.apply(this.server, arguments);
|
||||
exports.listen = function() {
|
||||
server = app.listen.apply(app, arguments);
|
||||
};
|
||||
|
||||
exports.close = function (callback) {
|
||||
this.server.close(callback);
|
||||
exports.close = function(callback) {
|
||||
server.close(callback);
|
||||
};
|
||||
|
Reference in New Issue
Block a user