From b8100967f3c795646129d8555ccf2e583b488b22 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Tue, 12 May 2026 22:18:05 +0200 Subject: [PATCH 1/3] test(calendar): remove unused logAllText helper Remove dead local debug helper in calendar e2e spec to resolve CodeQL alert #20. --- tests/electron/modules/calendar_spec.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index c37f3a434c..655e7e59c8 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -22,20 +22,6 @@ describe("Calendar module", () => { return await loc.count(); }; - /** - * Use this for debugging broken tests, it will console log the text of the calendar module - * @returns {Promise} - */ - // eslint-disable-next-line no-unused-vars - const logAllText = async () => { - expect(global.page).not.toBeNull(); - const loc = await global.page.locator(".calendar .event"); - const elem = loc.first(); - await elem.waitFor(); - expect(elem).not.toBeNull(); - console.log(await loc.allInnerTexts()); - }; - const first = 0; const second = 1; const third = 2; From 84e3b306fd0ec41f538942e987ffe87459c299ae Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Tue, 12 May 2026 22:31:07 +0200 Subject: [PATCH 2/3] refactor(core): explicit global exports for Loader/MMSocket Resolve CodeQL unused-local-variable alerts by keeping local const declarations and explicitly exporting both symbols to globalThis. Refs: #18, #19 --- js/loader.js | 3 ++- js/socketclient.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/loader.js b/js/loader.js index 31cf7cc0f4..a4fe273f01 100644 --- a/js/loader.js +++ b/js/loader.js @@ -1,6 +1,5 @@ /* global defaultModules, vendor */ -// eslint-disable-next-line no-unused-vars const Loader = (function () { /* Create helper variables */ @@ -295,3 +294,5 @@ const Loader = (function () { } }; }()); + +globalThis.Loader = Loader; diff --git a/js/socketclient.js b/js/socketclient.js index 0c3a7c6691..1f7b3f3a4c 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -1,6 +1,5 @@ /* global io */ -// eslint-disable-next-line no-unused-vars const MMSocket = function (moduleName) { if (typeof moduleName !== "string") { throw new Error("Please set the module name for the MMSocket."); @@ -45,3 +44,5 @@ const MMSocket = function (moduleName) { this.socket.emit(notification, payload); }; }; + +globalThis.MMSocket = MMSocket; From d94cd71357960519af75d9c15d266f45af864187 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Tue, 12 May 2026 21:53:57 +0200 Subject: [PATCH 3/3] test(e2e): clean up MM_PORT env var after test --- tests/e2e/port_spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/port_spec.js b/tests/e2e/port_spec.js index 341becc76b..8638d0e418 100644 --- a/tests/e2e/port_spec.js +++ b/tests/e2e/port_spec.js @@ -24,6 +24,7 @@ describe("port directive configuration", () => { afterAll(async () => { await helpers.stopApplication(); + delete process.env.MM_PORT; }); it("should return 200", async () => {