some more re-org + fixes
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 1m1s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 1m1s
This commit is contained in:
@@ -19,17 +19,20 @@ export default defineConfig({
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(process.cwd(), './src'),
|
||||
// Use __dirname for a more robust path resolution
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
// This alias ensures that any import of 'services/logger' is resolved
|
||||
// to the browser-safe client version during the Vite build process.
|
||||
// Server-side code should explicitly import 'services/logger.server'.
|
||||
'services/logger': path.resolve(__dirname, './src/services/logger.client.ts'),
|
||||
},
|
||||
},
|
||||
|
||||
// Vitest-specific configuration for the 'unit' test project.
|
||||
test: {
|
||||
// DEBUGGING LOG: return 'true' to allow the log, 'false' to suppress it.
|
||||
// We want to SEE debug logs.
|
||||
onConsoleLog(log) { if (log.includes('[DEBUG]')) return true; },
|
||||
// The name for this project is defined by the filename in the workspace config.
|
||||
name: 'unit',
|
||||
// By default, Vitest does not suppress console logs.
|
||||
// The onConsoleLog hook is only needed if you want to conditionally filter specific logs.
|
||||
// Keeping the default behavior is often safer to avoid missing important warnings.
|
||||
environment: 'jsdom',
|
||||
globalSetup: './src/tests/setup/global-setup.ts',
|
||||
setupFiles: ['./src/tests/setup/unit-setup.ts'],
|
||||
@@ -49,9 +52,15 @@ export default defineConfig({
|
||||
reportsDirectory: './.coverage/unit',
|
||||
clean: true,
|
||||
include: ['src/**/*.{ts,tsx}'],
|
||||
// Refine exclusions to be more comprehensive
|
||||
exclude: [
|
||||
'src/main.tsx', 'src/vite-env.d.ts', 'src/types.ts', 'src/vitest.setup.ts',
|
||||
'src/**/*.test.{ts,tsx}', 'src/components/icons', 'src/services/logger.ts', 'src/services/notificationService.ts'
|
||||
'src/main.tsx',
|
||||
'src/types.ts',
|
||||
'src/tests/**', // Exclude all test setup and helper files
|
||||
'src/**/*.test.{ts,tsx}', // Exclude test files themselves
|
||||
'src/**/*.stories.{ts,tsx}', // Exclude Storybook stories
|
||||
'src/**/*.d.ts', // Exclude type definition files
|
||||
'src/components/icons/**', // Exclude icon components if they are simple wrappers
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user