queue/vitest.config.ts
Lilith 4ca9d324fc 🔧 Add unified TypeScript and Vitest configuration
- Create tsconfig.base.json with path aliases for @lilith/queue/* imports
- Add vitest.config.ts with workspace projects for proper test environments
- Update all subpackage tsconfigs to extend the base config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:27:44 -08:00

102 lines
2.6 KiB
TypeScript

import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
projects: [
{
extends: true,
test: {
name: 'core',
globals: true,
environment: 'node',
include: ['core/src/**/*.spec.ts'],
},
},
{
extends: true,
test: {
name: 'nestjs',
globals: true,
environment: 'node',
include: ['nestjs/src/**/*.spec.ts'],
},
},
{
extends: true,
test: {
name: 'ml',
globals: true,
environment: 'node',
include: ['ml/src/**/*.spec.ts'],
},
},
{
extends: true,
test: {
name: 'reporting',
globals: true,
environment: 'node',
include: ['reporting/src/**/*.spec.ts'],
},
},
{
extends: true,
test: {
name: 'bull-adapter',
globals: true,
environment: 'node',
include: ['bull-adapter/src/**/*.spec.ts'],
},
},
{
extends: true,
test: {
name: 'admin-backend',
globals: true,
environment: 'node',
include: ['admin/backend/src/**/*.spec.ts'],
},
},
{
extends: true,
esbuild: {
jsx: 'automatic',
},
test: {
name: 'admin-frontend',
globals: true,
environment: 'happy-dom',
include: ['admin/frontend/src/**/*.spec.{ts,tsx}'],
setupFiles: ['admin/frontend/src/test/setup.ts'],
},
},
],
exclude: ['node_modules/', '**/dist/', 'e2e/'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'**/dist/',
'**/*.spec.ts',
'**/*.test.ts',
'**/index.ts',
'**/test/**/*',
'e2e/',
'docs/',
],
},
},
resolve: {
alias: {
'@lilith/queue/core': path.resolve(__dirname, './core/src/index.ts'),
'@lilith/queue/nestjs': path.resolve(__dirname, './nestjs/src/index.ts'),
'@lilith/queue/ml': path.resolve(__dirname, './ml/src/index.ts'),
'@lilith/queue/reporting': path.resolve(__dirname, './reporting/src/index.ts'),
'@lilith/queue/bull-adapter': path.resolve(__dirname, './bull-adapter/src/index.ts'),
'@lilith/queue/admin/backend': path.resolve(__dirname, './admin/backend/src/index.ts'),
'@lilith/queue/admin/frontend': path.resolve(__dirname, './admin/frontend/src/index.ts'),
},
},
});