Преглед изворни кода

✅ test(advertisements-module): add vitest configuration file

- create vitest.config.ts for advertisements module testing
- configure test environment as node with globals enabled
- set up coverage reporting with v8 provider and multiple reporters
- exclude test files and configs from coverage calculation
- disable file parallelism to prevent database connection conflicts
yourname пре 1 месец
родитељ
комит
a614602def
1 измењених фајлова са 21 додато и 0 уклоњено
  1. 21 0
      packages/advertisements-module/vitest.config.ts

+ 21 - 0
packages/advertisements-module/vitest.config.ts

@@ -0,0 +1,21 @@
+import { defineConfig } from 'vitest/config';
+
+export default defineConfig({
+  test: {
+    globals: true,
+    environment: 'node',
+    include: ['tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
+    coverage: {
+      provider: 'v8',
+      reporter: ['text', 'json', 'html'],
+      exclude: [
+        'tests/**',
+        '**/*.d.ts',
+        '**/*.config.*',
+        '**/dist/**'
+      ]
+    },
+    // 关闭并行测试以避免数据库连接冲突
+    fileParallelism: false
+  }
+});