From 395a7f41fee4c60906c0189380f327404c77c9e1 Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 8 Oct 2026 10:16:33 +0200 Subject: [PATCH] test(client): keep the login's background trip sync out of the push spec A successful login starts tripSyncManager.syncAll() without waiting for it. In authStore.push.test.ts that sync was real and could still be logging when the worker shut down, which vitest reports as an unhandled "Closing rpc while onUserConsoleLog was pending" and fails the coverage job although every test passed. The spec is about push, so the sync is stubbed. --- client/tests/unit/stores/authStore.push.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/tests/unit/stores/authStore.push.test.ts b/client/tests/unit/stores/authStore.push.test.ts index a97e6c4f6..686ae6cf6 100644 --- a/client/tests/unit/stores/authStore.push.test.ts +++ b/client/tests/unit/stores/authStore.push.test.ts @@ -25,6 +25,13 @@ vi.mock('../../../src/sync/syncTriggers', () => ({ unregisterSyncTriggers: vi.fn(), })); +// Login kicks off a full trip sync it does not wait for. Left real, that sync +// can still be logging when the file's worker shuts down, and vitest reports +// the cut-off console call as an unhandled error. Nothing here is about sync. +vi.mock('../../../src/sync/tripSyncManager', () => ({ + tripSyncManager: { syncAll: vi.fn(async () => {}) }, +})); + beforeEach(() => { resetAllStores(); vi.clearAllMocks();