mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
29 lines
668 B
JavaScript
29 lines
668 B
JavaScript
const fetch = require("node-fetch");
|
|
const app = require("../../js/app.js");
|
|
|
|
describe("Electron app environment", function () {
|
|
beforeAll(function () {
|
|
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
|
|
|
|
app.start();
|
|
});
|
|
|
|
afterAll(function () {
|
|
app.stop();
|
|
});
|
|
|
|
it("get request from http://localhost:8080 should return 200", function (done) {
|
|
fetch("http://localhost:8080").then((res) => {
|
|
expect(res.status).toBe(200);
|
|
done();
|
|
});
|
|
});
|
|
|
|
it("get request from http://localhost:8080/nothing should return 404", function (done) {
|
|
fetch("http://localhost:8080/nothing").then((res) => {
|
|
expect(res.status).toBe(404);
|
|
done();
|
|
});
|
|
});
|
|
});
|