mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 13:09:26 +00:00
refactor e2e
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
const fetch = require("node-fetch");
|
||||
const app = require("app.js");
|
||||
const helpers = require("./global-setup");
|
||||
let app = null;
|
||||
|
||||
describe("port directive configuration", function () {
|
||||
beforeAll(function () {
|
||||
process.env.MM_CONFIG_FILE = "tests/configs/port_8090.js";
|
||||
|
||||
app.start();
|
||||
});
|
||||
|
||||
afterAll(function () {
|
||||
app.stop();
|
||||
});
|
||||
|
||||
describe("Set port 8090", function () {
|
||||
beforeAll(function () {
|
||||
app = helpers.startApplication("tests/configs/port_8090.js");
|
||||
});
|
||||
afterAll(function () {
|
||||
helpers.stopApplication(app);
|
||||
});
|
||||
|
||||
it("should return 200", function (done) {
|
||||
fetch("http://localhost:8090").then((res) => {
|
||||
expect(res.status).toBe(200);
|
||||
@@ -23,11 +21,10 @@ describe("port directive configuration", function () {
|
||||
|
||||
describe("Set port 8100 on environment variable MM_PORT", function () {
|
||||
beforeAll(function () {
|
||||
process.env.MM_PORT = 8100;
|
||||
app = helpers.startApplication("tests/configs/port_8090.js", (process.env.MM_PORT = 8100));
|
||||
});
|
||||
|
||||
afterAll(function () {
|
||||
delete process.env.MM_PORT;
|
||||
helpers.stopApplication(app);
|
||||
});
|
||||
|
||||
it("should return 200", function (done) {
|
||||
|
Reference in New Issue
Block a user