dd67f28745
Centralizes the inline { page: { get url() { return state.pageUrl } } }
mock shape via test-utils/mocks/appState.ts. The vi.hoisted state
declaration remains per-file (vitest mock-hoisting requires module-
level declaration). Adds a $test-utils alias to svelte.config.js so
the helper can be imported without ../../../ chains.
SKIPPED (mock exposes more than url):
- Shell.test.ts, MobileNavDrawer.test.ts, admin.test.ts: static
page: { url: ... } shape, no hoisted state to centralize.
- album.test.ts, artist.test.ts: page exposes both params and url.
- playlist.test.ts, reset-password.test.ts: page exposes params only.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 lines
620 B
JavaScript
25 lines
620 B
JavaScript
import adapter from '@sveltejs/adapter-static';
|
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
|
|
export default {
|
|
preprocess: vitePreprocess(),
|
|
kit: {
|
|
adapter: adapter({
|
|
pages: 'build',
|
|
assets: 'build',
|
|
fallback: 'index.html',
|
|
precompress: false,
|
|
strict: false
|
|
}),
|
|
files: {
|
|
assets: 'static'
|
|
},
|
|
alias: {
|
|
// test-only helper barrel; resolves the same way $lib does so test
|
|
// files can import shared mock factories without ../../../ chains.
|
|
'$test-utils': 'src/test-utils',
|
|
'$test-utils/*': 'src/test-utils/*'
|
|
}
|
|
}
|
|
};
|