test(confirm-service): normalise vi.mock spelling and remove duplicate-id mocks
Five test files mocked $lib/shared/services/confirm.svelte under BOTH spellings (.svelte and .svelte.js) within the same file; two more mocked only the .svelte.js form. Both resolve to the same module URL but register two distinct Playwright route handlers in @vitest/browser-playwright. The cleanup logic only removes one, leaving an orphan that fires when the next session loads the module — crashing the run with "[birpc] rpc is closed, cannot call resolveManualMock". This is the exact trigger fixed upstream by vitest PR #10267 (issue #9957). Normalise every confirm.svelte mock to the no-extension form, matching production imports and the source file basename (confirm.svelte.ts). After this commit: 8 confirm.svelte mocks across 8 spec files, all under one canonical ID. A meta-test (next commit) prevents the duplicate-id pattern from reappearing. Refs: #553 · vitest-dev/vitest#9957 · vitest-dev/vitest#10267 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,9 +5,6 @@ import { page } from 'vitest/browser';
|
||||
vi.mock('$lib/shared/services/confirm.svelte', () => ({
|
||||
getConfirmService: () => ({ confirm: async () => false })
|
||||
}));
|
||||
vi.mock('$lib/shared/services/confirm.svelte.js', () => ({
|
||||
getConfirmService: () => ({ confirm: async () => false })
|
||||
}));
|
||||
|
||||
const { default: TranscriptionEditView } = await import('./TranscriptionEditView.svelte');
|
||||
import type { TranscriptionBlockData } from '$lib/shared/types';
|
||||
|
||||
Reference in New Issue
Block a user