From 2c30e2986cb75e4bbe4f9075436fd4877ddc6e0a Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 13 Jul 2025 20:04:15 +0200 Subject: [PATCH 1/5] refactor: standardize collectCoverageFrom paths in jest config --- jest.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 0faea8b91d..dcb1fe38bc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -25,7 +25,12 @@ module.exports = async () => { testPathIgnorePatterns: ["/tests/e2e/helpers", "/tests/e2e/mocks"] } ], - collectCoverageFrom: ["./clientonly/**/*.js", "./js/**/*.js", "./modules/default/**/*.js", "./serveronly/**/*.js"], + collectCoverageFrom: [ + "/clientonly/**/*.js", + "/js/**/*.js", + "/modules/default/**/*.js", + "/serveronly/**/*.js" + ], coverageReporters: ["lcov", "text"], coverageProvider: "v8" }; From 4a856331977b0723158aaaf1bc244bd89f08e275 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 13 Jul 2025 20:04:35 +0200 Subject: [PATCH 2/5] refactor: change jest config to synchronous module export --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index dcb1fe38bc..f91dc4049c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,4 @@ -module.exports = async () => { +module.exports = () => { return { verbose: true, testTimeout: 20000, From 88efb84a7a0e64e89ae53910cdf52059bddc0cdc Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 13 Jul 2025 20:55:37 +0200 Subject: [PATCH 3/5] refactor: simplify jest config by removing unnecessary function wrapper --- jest.config.js | 70 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/jest.config.js b/jest.config.js index f91dc4049c..cc65330fee 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,37 +1,37 @@ -module.exports = () => { - return { - verbose: true, - testTimeout: 20000, - testSequencer: "/tests/utils/test_sequencer.js", - projects: [ - { - displayName: "unit", - globalSetup: "/tests/unit/helpers/global-setup.js", - moduleNameMapper: { - logger: "/js/logger.js" - }, - testMatch: ["**/tests/unit/**/*.[jt]s?(x)"], - testPathIgnorePatterns: ["/tests/unit/mocks", "/tests/unit/helpers"] +const config = { + verbose: true, + testTimeout: 20000, + testSequencer: "/tests/utils/test_sequencer.js", + projects: [ + { + displayName: "unit", + globalSetup: "/tests/unit/helpers/global-setup.js", + moduleNameMapper: { + logger: "/js/logger.js" }, - { - displayName: "electron", - testMatch: ["**/tests/electron/**/*.[jt]s?(x)"], - testPathIgnorePatterns: ["/tests/electron/helpers"] - }, - { - displayName: "e2e", - testMatch: ["**/tests/e2e/**/*.[jt]s?(x)"], - modulePaths: ["/js/"], - testPathIgnorePatterns: ["/tests/e2e/helpers", "/tests/e2e/mocks"] - } - ], - collectCoverageFrom: [ - "/clientonly/**/*.js", - "/js/**/*.js", - "/modules/default/**/*.js", - "/serveronly/**/*.js" - ], - coverageReporters: ["lcov", "text"], - coverageProvider: "v8" - }; + testMatch: ["**/tests/unit/**/*.[jt]s?(x)"], + testPathIgnorePatterns: ["/tests/unit/mocks", "/tests/unit/helpers"] + }, + { + displayName: "electron", + testMatch: ["**/tests/electron/**/*.[jt]s?(x)"], + testPathIgnorePatterns: ["/tests/electron/helpers"] + }, + { + displayName: "e2e", + testMatch: ["**/tests/e2e/**/*.[jt]s?(x)"], + modulePaths: ["/js/"], + testPathIgnorePatterns: ["/tests/e2e/helpers", "/tests/e2e/mocks"] + } + ], + collectCoverageFrom: [ + "/clientonly/**/*.js", + "/js/**/*.js", + "/modules/default/**/*.js", + "/serveronly/**/*.js" + ], + coverageReporters: ["lcov", "text"], + coverageProvider: "v8" }; + +module.exports = config; From e0f0eb314efc73b0c00e7c09247b8a41a7966784 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 13 Jul 2025 20:56:12 +0200 Subject: [PATCH 4/5] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d780a5feb..c7aed2fc73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Thanks to: @dathbe. - [clock] Add CSS to prevent line breaking of sunset/sunrise time display (#3816) - [core] Enhance system information logging format and include additional env and RAM details (#3839, #3843) - [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837) +- [tests] refactor: simplify jest config file ### Updated From 6eabccd87580335ba6de5c4c080a487c3b68dab6 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 13 Jul 2025 21:13:32 +0200 Subject: [PATCH 5/5] docs: add PR id --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7aed2fc73..dcdf993a93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ Thanks to: @dathbe. - [clock] Add CSS to prevent line breaking of sunset/sunrise time display (#3816) - [core] Enhance system information logging format and include additional env and RAM details (#3839, #3843) - [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837) -- [tests] refactor: simplify jest config file +- [tests] refactor: simplify jest config file (#3844) ### Updated