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 : [
1012 'test/test.{js,mjs,cjs,ts,mts,cts}' ,
13+ 'test/*.{js,mjs,cjs,ts,mts,cts}' ,
1114 'test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts}' ,
1215 'test/{as-input-plugin,as-output-plugin,form,function,misc,sourcemaps}.{js,mjs,cjs,ts,mts,cts}'
1316 ] ,
@@ -20,6 +23,8 @@ export default defineConfig({
2023 '**/test/snapshots/**' ,
2124 '**/test/types.ts'
2225 ] ,
26+ // These tests switch process cwd and invoke package managers; run files serially there.
27+ fileParallelism : ! isAutoInstallPackage ,
2328 // Keep snapshots in the same location used by Ava.
2429 resolveSnapshotPath : ( testPath , snapExt ) =>
2530 path . join ( path . dirname ( testPath ) , 'snapshots' , path . basename ( testPath ) + snapExt )
0 commit comments