import { describe, expect, test, vi } from 'vitest'; import { goto } from '$app/navigation'; import { page } from '$app/state'; // Guards the suite-wide $app mocks in vitest.setup.ts (#3943). If they are // removed, tests that never mock $app themselves go back to loading // SvelteKit's client runtime, which fails at module load on some CI runs. describe('suite-wide SvelteKit app-module mocks', () => { test('$app/navigation is the mock, not the client runtime', () => { expect(vi.isMockFunction(goto)).toBe(true); }); test('$app/state gives a page at the root URL', () => { expect(page.url.pathname).toBe('/'); }); });