Skip to content

Commit f99ce28

Browse files
docs(OUT-3586): correct globalSetup comment referencing Vitest config
Replace the stale singleFork=true reference with the actual mechanism — pool: 'forks' + fileParallelism: false — so a future maintainer searching the config for singleFork doesn't come up empty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e3ab0b2 commit f99ce28

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

test/integration/globalSetup.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import postgres from 'postgres'
2020
* - Stop the container on teardown
2121
*
2222
* Env var propagation: Vitest spawns worker processes AFTER globalSetup resolves,
23-
* so process.env set here is inherited by workers. Combined with singleFork=true
24-
* in vitest.config.ts, this gives us one container shared across all integration
25-
* test files.
23+
* so process.env set here is inherited by workers. Combined with `pool: 'forks'`
24+
* and `fileParallelism: false` in vitest.config.ts, this gives us one container
25+
* shared across all integration test files.
2626
*/
2727

2828
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -52,8 +52,11 @@ export default async function globalSetup() {
5252
console.info('[globalSetup] Running Drizzle migrations...')
5353
const migrationClient = postgres(url, { max: 1, prepare: false })
5454
const migrationDb = drizzle(migrationClient)
55-
await migrate(migrationDb, { migrationsFolder: MIGRATIONS_FOLDER })
56-
await migrationClient.end()
55+
try {
56+
await migrate(migrationDb, { migrationsFolder: MIGRATIONS_FOLDER })
57+
} finally {
58+
await migrationClient.end()
59+
}
5760

5861
console.info(`[globalSetup] Ready: ${url}`)
5962

0 commit comments

Comments
 (0)