diff --git a/src/behaviours/application-update/periodical-checking-of-updates.test.ts b/src/behaviours/application-update/periodical-checking-of-updates.test.ts index 4d63991abc..e81c002e34 100644 --- a/src/behaviours/application-update/periodical-checking-of-updates.test.ts +++ b/src/behaviours/application-update/periodical-checking-of-updates.test.ts @@ -10,7 +10,7 @@ import publishIsConfiguredInjectable from "../../main/application-update/publish import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; -import startCheckingForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable"; +import periodicalCheckForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; const ENOUGH_TIME = 1000 * 60 * 60 * 2; @@ -24,7 +24,8 @@ describe("periodical checking of updates", () => { applicationBuilder = getApplicationBuilder(); applicationBuilder.beforeApplicationStart(({ mainDi }) => { - mainDi.unoverride(startCheckingForUpdatesInjectable); + mainDi.unoverride(periodicalCheckForUpdatesInjectable); + mainDi.permitSideEffects(periodicalCheckForUpdatesInjectable); processCheckingForUpdatesMock = asyncFn(); diff --git a/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts b/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts index e1d2af1aaa..394383ee65 100644 --- a/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts +++ b/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts @@ -28,6 +28,8 @@ const periodicalCheckForUpdatesInjectable = getInjectable({ }; }); }, + + causesSideEffects: true, }); export default periodicalCheckForUpdatesInjectable; diff --git a/src/main/getDiForUnitTesting.ts b/src/main/getDiForUnitTesting.ts index d895650bca..9d401d31bb 100644 --- a/src/main/getDiForUnitTesting.ts +++ b/src/main/getDiForUnitTesting.ts @@ -84,9 +84,10 @@ import setUpdateOnQuitInjectable from "./electron-app/features/set-update-on-qui import downloadPlatformUpdateInjectable from "./application-update/download-platform-update/download-platform-update.injectable"; import startCatalogSyncInjectable from "./catalog-sync-to-renderer/start-catalog-sync.injectable"; import startKubeConfigSyncInjectable from "./start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable"; -import startCheckingForUpdatesInjectable from "./application-update/periodical-check-for-updates/start-checking-for-updates.injectable"; import appVersionInjectable from "../common/get-configuration-file-model/app-version/app-version.injectable"; import getRandomIdInjectable from "../common/utils/get-random-id.injectable"; +import periodicalCheckForUpdatesInjectable + from "./application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; export function getDiForUnitTesting(opts: GetDiForUnitTestingOptions = {}) { const { @@ -135,7 +136,7 @@ export function getDiForUnitTesting(opts: GetDiForUnitTestingOptions = {}) { di.override(applicationMenuInjectable, () => ({ start: () => {}, stop: () => {} })); - di.override(startCheckingForUpdatesInjectable, () => ({ run: () => {} })); + di.override(periodicalCheckForUpdatesInjectable, () => ({ start: () => {}, stop: () => {}, started: false })); // TODO: Remove usages of globally exported appEventBus to get rid of this di.override(appEventBusInjectable, () => new EventEmitter<[AppEvent]>());