MagicMirror/tests/e2e/port_config.js
Karsten Hassel 9969fede35 refactor e2e
2021-09-16 23:02:17 +02:00

38 lines
941 B
JavaScript

const fetch = require("node-fetch");
const helpers = require("./global-setup");
let app = null;
describe("port directive configuration", function () {
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);
done();
});
});
});
describe("Set port 8100 on environment variable MM_PORT", function () {
beforeAll(function () {
app = helpers.startApplication("tests/configs/port_8090.js", (process.env.MM_PORT = 8100));
});
afterAll(function () {
helpers.stopApplication(app);
});
it("should return 200", function (done) {
fetch("http://localhost:8100").then((res) => {
expect(res.status).toBe(200);
done();
});
});
});
});