mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-07-21 18:26:43 -07:00
move default modules from /modules/default to /defaultmodules (#4019)
Since the project's inception, I've missed a clear separation between default and third-party modules. This increases complexity within the project (exclude `modules`, but not `modules/default`), but the mixed use is particularly problematic in Docker setups. Therefore, with this pull request, I'm moving the default modules to a different directory. ~~I've chosen `default/modules`, but I'm not bothered about it; `defaultmodules` or something similar would work just as well.~~ Changed to `defaultmodules`. Let me know if there's a majority in favor of this change.
This commit is contained in:
@@ -16,12 +16,13 @@ describe("Compliments module", () => {
|
||||
global.Cron = vi.fn();
|
||||
|
||||
// Load the module
|
||||
require("../../../../../modules/default/compliments/compliments");
|
||||
const defaults = require("../../../../../js/defaults");
|
||||
require(`../../../../../${defaults.defaultModulesDir}/compliments/compliments`);
|
||||
|
||||
// Setup module instance
|
||||
complimentsModule.config = { ...complimentsModule.defaults };
|
||||
complimentsModule.name = "compliments";
|
||||
complimentsModule.file = vi.fn((path) => `http://localhost:8080/modules/default/compliments/${path}`);
|
||||
complimentsModule.file = vi.fn((path) => `http://localhost:8080/${defaults.defaultModulesDir}/compliments/${path}`);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -144,7 +145,7 @@ describe("Compliments module", () => {
|
||||
await complimentsModule.loadComplimentFile();
|
||||
|
||||
const calledUrl = fetch.mock.calls[0][0];
|
||||
expect(calledUrl).toBe("http://localhost:8080/modules/default/compliments/compliments.json");
|
||||
expect(calledUrl).toBe("http://localhost:8080/defaultmodules/compliments/compliments.json");
|
||||
expect(calledUrl).not.toContain("dummy=");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user