mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user