diff --git a/src/main/services/autoUpdater.ts b/src/main/services/autoUpdater.ts index eefda72..4089155 100644 --- a/src/main/services/autoUpdater.ts +++ b/src/main/services/autoUpdater.ts @@ -192,7 +192,7 @@ export class AutoUpdateService { } start(): void { - if (this.started || !this.options.isPackaged) { + if (this.started) { return; } diff --git a/tests/main/autoUpdater.test.ts b/tests/main/autoUpdater.test.ts index 4912a02..7394e85 100644 --- a/tests/main/autoUpdater.test.ts +++ b/tests/main/autoUpdater.test.ts @@ -64,18 +64,20 @@ class FakeScheduler implements AutoUpdateScheduler { } describe('AutoUpdateService', () => { - test('does not schedule checks for unpackaged apps but manual checks still work', async () => { + test('schedules checks for unpackaged apps using dev update config', async () => { const updater = new FakeUpdater(); const scheduler = new FakeScheduler(); const service = new AutoUpdateService({ isPackaged: false, scheduler, updater }); service.start(); - expect(scheduler.timeouts).toHaveLength(0); - expect(scheduler.intervals).toHaveLength(0); expect(updater.forceDevUpdateConfig).toBe(true); + expect(scheduler.timeouts).toEqual([{ callback: expect.any(Function), delayMs: 10_000 }]); + expect(scheduler.intervals).toEqual([{ callback: expect.any(Function), delayMs: 4 * 60 * 60 * 1000 }]); + + await scheduler.runTimeout(); + await Promise.resolve(); - await service.checkForUpdates(); expect(updater.checkForUpdatesCalls).toBe(1); });