mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-04-25 23:32:10 +00:00
- remove param `--enable-features=UseOzonePlatform` in start electron tests (as we did already in `package.json`) - update node versions in github workflows, remove `22.21.1`, add `25.x` - fix formatting in tests - update dependencies including electron to v40 This is still a draft PR because most calendar electron tests are not running which is caused by the electron update from `v39.3.0` to `v40.0.0`. Maybe @KristjanESPERANTO has an idea ... --------- Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
30 lines
951 B
JavaScript
30 lines
951 B
JavaScript
const helpers = require("./helpers/global-setup");
|
|
|
|
describe("All font files from roboto.css should be downloadable", () => {
|
|
const fontFiles = [];
|
|
// Statements below filters out all 'url' lines in the CSS file
|
|
const fileContent = require("node:fs").readFileSync(`${global.root_path}/css/roboto.css`, "utf8");
|
|
const regex = /\burl\(['"]([^'"]+)['"]\)/g;
|
|
let match = regex.exec(fileContent);
|
|
while (match !== null) {
|
|
// Push 1st match group onto fontFiles stack
|
|
fontFiles.push(match[1]);
|
|
// Find the next one
|
|
match = regex.exec(fileContent);
|
|
}
|
|
|
|
beforeAll(async () => {
|
|
await helpers.startApplication("tests/configs/without_modules.js");
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
it.each(fontFiles)("should return 200 HTTP code for file '%s'", async (fontFile) => {
|
|
const fontUrl = `http://localhost:8080/fonts/${fontFile}`;
|
|
const res = await fetch(fontUrl);
|
|
expect(res.status).toBe(200);
|
|
});
|
|
});
|