mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 04:59:32 +00:00
added test for MM_MODULES_DIR
(#3546)
uses newsfeed test after copying this module to config dir addition for #3530
This commit is contained in:
parent
65d7e2d067
commit
8f5aa50d79
@ -13,7 +13,7 @@ _This release is scheduled to be released on 2024-10-01._
|
|||||||
|
|
||||||
- [core] Check config at every start of MagicMirror² (#3450)
|
- [core] Check config at every start of MagicMirror² (#3450)
|
||||||
- [core] Add spelling check (cspell): `npm run test:spelling` and handle spelling issues (#3544)
|
- [core] Add spelling check (cspell): `npm run test:spelling` and handle spelling issues (#3544)
|
||||||
- [core] removed `config.paths.vendor` (could not work because `vendor` is hardcoded in `index.html`), renamed `config.paths.modules` to `config.foreignModulesDir`, added variable `MM_CUSTOMCSS_FILE` which - if set - overrides `config.customCss`, added variable `MM_MODULES_DIR` which - if set - overrides `config.foreignModulesDir` (#3530)
|
- [core] removed `config.paths.vendor` (could not work because `vendor` is hardcoded in `index.html`), renamed `config.paths.modules` to `config.foreignModulesDir`, added variable `MM_CUSTOMCSS_FILE` which - if set - overrides `config.customCss`, added variable `MM_MODULES_DIR` which - if set - overrides `config.foreignModulesDir`, added test for `MM_MODULES_DIR` (#3530)
|
||||||
- [core] elements are now removed from `index.html` when loading script or stylesheet files fails
|
- [core] elements are now removed from `index.html` when loading script or stylesheet files fails
|
||||||
- [core] Added `DOM_OBJECTS_UPDATED` notification each time the DOM is re-rendered via `updateDom` (#3534)
|
- [core] Added `DOM_OBJECTS_UPDATED` notification each time the DOM is re-rendered via `updateDom` (#3534)
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
|
const fs = require("node:fs");
|
||||||
const helpers = require("../helpers/global-setup");
|
const helpers = require("../helpers/global-setup");
|
||||||
|
|
||||||
describe("Newsfeed module", () => {
|
const runTests = async () => {
|
||||||
afterAll(async () => {
|
|
||||||
await helpers.stopApplication();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Default configuration", () => {
|
describe("Default configuration", () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await helpers.startApplication("tests/configs/modules/newsfeed/default.js");
|
await helpers.startApplication("tests/configs/modules/newsfeed/default.js");
|
||||||
@ -74,4 +71,28 @@ describe("Newsfeed module", () => {
|
|||||||
expect(elem.textContent).toContain("No news at the moment.");
|
expect(elem.textContent).toContain("No news at the moment.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
describe("Newsfeed module", () => {
|
||||||
|
afterAll(async () => {
|
||||||
|
await helpers.stopApplication();
|
||||||
|
});
|
||||||
|
|
||||||
|
runTests();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Newsfeed module located in config directory", () => {
|
||||||
|
beforeAll(async () => {
|
||||||
|
const baseDir = `${__dirname}/../../..`;
|
||||||
|
if (!fs.existsSync(`${baseDir}/config/newsfeed`)) {
|
||||||
|
await fs.cp(`${baseDir}/modules/default/newsfeed`, `${baseDir}/config/newsfeed`, { recursive: true }, (err) => err && console.error(err));
|
||||||
|
}
|
||||||
|
process.env.MM_MODULES_DIR = "config";
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async () => {
|
||||||
|
await helpers.stopApplication();
|
||||||
|
});
|
||||||
|
|
||||||
|
runTests();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user