Преглед на файлове

fix(test): expand Windows short paths with native realpath

lingfengQAQ преди 4 дни
родител
ревизия
5f6bb49632
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      vitest.config.ts

+ 3 - 2
vitest.config.ts

@@ -4,14 +4,15 @@ import { tmpdir } from 'node:os';
 
 // Windows runners expose an 8.3 TEMP alias; fixtures and fault-injection mocks
 // must use the same canonical path that the filesystem returns to production.
-const testTemp = realpathSync(tmpdir());
+const testTemp = realpathSync.native(tmpdir());
 
 export default defineConfig({
   test: {
     include: ['packages/*/tests/**/*.spec.ts', 'packages/*/src/**/*.spec.ts'],
     environment: 'node',
     // Many integration files spawn Git/Node processes; bound contention on CI.
-    maxWorkers: 4,
+    maxWorkers: process.env['CI'] ? 2 : 4,
+    testTimeout: 15_000,
     env: { TEMP: testTemp, TMP: testTemp, TMPDIR: testTemp },
   },
 });