From c719c43a4be9d5eb3636adf227e709fde7a9b5d2 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Sat, 9 May 2026 20:59:53 +0200 Subject: [PATCH] remove warning in unit tests (for nodejs >= v25) --- .github/workflows/automated-tests.yaml | 2 +- tests/utils/vitest-setup.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automated-tests.yaml b/.github/workflows/automated-tests.yaml index dd3e588bd3..13ff5aea49 100644 --- a/.github/workflows/automated-tests.yaml +++ b/.github/workflows/automated-tests.yaml @@ -39,7 +39,7 @@ jobs: timeout-minutes: 30 strategy: matrix: - node-version: [22.x, 24.x, 26.x] + node-version: [22.x, 24.x, 26.0.0] steps: - name: Install electron dependencies and labwc run: | diff --git a/tests/utils/vitest-setup.js b/tests/utils/vitest-setup.js index dfb5b1c521..c1e0a3bec9 100644 --- a/tests/utils/vitest-setup.js +++ b/tests/utils/vitest-setup.js @@ -9,6 +9,10 @@ const path = require("node:path"); // Set test mode flag for application code to detect test environment process.env.mmTestMode = "true"; +// overrides native implementation (Nodejs >= v25) to avoid warnings in tests +// "ExperimentalWarning: localStorage is not available because --localstorage-file was not provided." +Object.defineProperty(globalThis, "localStorage", { value: undefined, writable: true }); + // Store the original require const originalRequire = Module.prototype.require;