bb1ab3a2e3
Root cause: discover.test.ts and requests.test.ts were the only route
page tests NOT mocking $app/state (+ $app/navigation), so rendering
the +page.svelte pulled in SvelteKit's client runtime and threw
`TypeError: notifiable_store is not a function` at module load. They'd
been describe.skip'd AND hard-excluded in vitest.config.ts.
Fix mirrors every other route test: vi.hoisted pageState +
vi.mock('$app/state', () => pageUrlModule(state)) +
vi.mock('$app/navigation', () => ({ goto: vi.fn() })). Un-skip both
describe blocks; drop the vitest.config exclude. The web test job
now runs both suites again.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
14 lines
456 B
TypeScript
14 lines
456 B
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { svelteTesting } from '@testing-library/svelte/vite';
|
|
import { configDefaults, defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
plugins: [sveltekit(), svelteTesting()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
include: ['src/**/*.test.ts', 'src/**/*.svelte.test.ts', 'scripts/**/*.test.js'],
|
|
exclude: [...configDefaults.exclude],
|
|
setupFiles: ['./vitest.setup.ts']
|
|
}
|
|
});
|