import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {
    globals: true,
    environment: 'node',
    include: ['tests/**/*.test.ts'],
    coverage: {
      provider: 'v8',
      reporter: ['text', 'json', 'html'],
      exclude: ['node_modules/', 'tests/']
    },
    // 关闭文件并行测试以避免数据库连接冲突
    fileParallelism: false,
    // 设置最大工作线程数为1，确保测试顺序执行
    maxWorkers: 1,
    // 设置最小工作线程数为1
    minWorkers: 1
  }
});