11import { defineConfig } from 'vitest/config' ;
22import path from 'node:path' ;
33
4+ const isAutoInstallPackage = path . basename ( process . cwd ( ) ) === 'auto-install' ;
5+
46export default defineConfig ( {
57 test : {
68 // Enable global APIs for CommonJS test files.
79 globals : true ,
8- // Phase 1/2 packages use runtime-style, *.test, and a few named entrypoints.
10+ // Phase 1/2/3 packages use runtime-style, top-level test files , *.test, and a few named entrypoints.
911 include : [
10- 'test/test .{js,mjs,cjs,ts,mts,cts}' ,
12+ 'test/* .{js,mjs,cjs,ts,mts,cts}' ,
1113 'test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts}' ,
1214 'test/{as-input-plugin,as-output-plugin,form,function,misc,sourcemaps}.{js,mjs,cjs,ts,mts,cts}'
1315 ] ,
@@ -20,6 +22,8 @@ export default defineConfig({
2022 '**/test/snapshots/**' ,
2123 '**/test/types.ts'
2224 ] ,
25+ // These tests switch process cwd and invoke package managers; run files serially there.
26+ fileParallelism : ! isAutoInstallPackage ,
2327 // Keep snapshots in the same location used by Ava.
2428 resolveSnapshotPath : ( testPath , snapExt ) =>
2529 path . join ( path . dirname ( testPath ) , 'snapshots' , path . basename ( testPath ) + snapExt )
0 commit comments