c13b580bac
CI / test (push) Successful in 29s
CI / lint (push) Failing after 25s
CI / secrets-scan (push) Successful in 5s
CI / vuln-scan (push) Successful in 14s
CI / sast (push) Successful in 10s
CI / build-images (push) Has been skipped
CI / image-scan (push) Has been skipped
CI / push (push) Has been skipped
Browsers' native PDF viewer refused to load blob-URL PDFs inside the ReceiptViewer iframe (the "Click here to load" placeholder did nothing, even though Open-in-new-tab worked). Replace the iframe with react-pdf rendering on a canvas so we no longer depend on the in-iframe viewer: fit-to-width Page, paginated nav for multi-page docs, selectable text layer, and a Print button. The viewer is React.lazy-loaded so image-only users don't download the pdfjs worker chunk. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
901 B
TypeScript
39 lines
901 B
TypeScript
import path from 'path';
|
|
import { defineConfig } from 'vitest/config';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'virtual:pwa-register/react': path.resolve(__dirname, './src/test/pwa-register-mock.ts'),
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'lcov'],
|
|
include: ['src/**/*.{ts,tsx}'],
|
|
exclude: [
|
|
'src/components/ui/**',
|
|
'src/test/**',
|
|
'src/lib/pdf-worker.ts',
|
|
'src/main.tsx',
|
|
'src/vite-env.d.ts',
|
|
'src/**/*.d.ts',
|
|
'**/*.config.*',
|
|
],
|
|
thresholds: {
|
|
statements: 90,
|
|
branches: 90,
|
|
functions: 90,
|
|
lines: 90,
|
|
},
|
|
},
|
|
},
|
|
});
|