diff --git a/web/src/lib/test-setup.ts b/web/src/lib/test-setup.ts new file mode 100644 index 0000000..37b9389 --- /dev/null +++ b/web/src/lib/test-setup.ts @@ -0,0 +1 @@ +import 'fake-indexeddb/auto'; diff --git a/web/vite.config.ts b/web/vite.config.ts index ac295eb..b83ce99 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -25,18 +25,7 @@ export default defineConfig({ cleanupOutdatedCaches: true, clientsClaim: true, navigateFallback: '/index.html', - navigateFallbackDenylist: [/^\/api/, /^\/healthz/], - runtimeCaching: [ - { - urlPattern: /^\/api\//, - handler: 'NetworkFirst', - options: { - cacheName: 'api-cache', - networkTimeoutSeconds: 5, - cacheableResponse: { statuses: [0, 200] } - } - } - ] + navigateFallbackDenylist: [/^\/api/, /^\/_/, /^\/healthz/] }, devOptions: { enabled: true, @@ -59,13 +48,14 @@ export default defineConfig({ ], server: { proxy: { - '/api': 'http://localhost:8080', - '/healthz': 'http://localhost:8080' + '/api': { target: 'http://127.0.0.1:8080', changeOrigin: true }, + '/_': { target: 'http://127.0.0.1:8080', changeOrigin: true } } }, test: { environment: 'jsdom', globals: true, - include: ['src/**/*.test.ts'] + include: ['src/**/*.test.ts'], + setupFiles: ['./src/lib/test-setup.ts'] } });