mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 13:09:26 +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:
@@ -1,10 +1,7 @@
|
||||
const fs = require("node:fs");
|
||||
const helpers = require("../helpers/global-setup");
|
||||
|
||||
describe("Newsfeed module", () => {
|
||||
afterAll(async () => {
|
||||
await helpers.stopApplication();
|
||||
});
|
||||
|
||||
const runTests = async () => {
|
||||
describe("Default configuration", () => {
|
||||
beforeAll(async () => {
|
||||
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.");
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user