Files
GearBox/tests/setup.ts
Jean-Luc Makiola 9649ef2514
All checks were successful
CI / ci (push) Successful in 1m40s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 58s
fix: close PGlite handle after tests to resolve exit code 100
PGlite's WASM worker kept an open async handle, causing Bun to detect
a resource leak and exit with code 100 despite all tests passing.
Adds a preload script that closes the cached client via afterAll.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 16:43:11 +02:00

10 lines
272 B
TypeScript

// Bun test preload: close PGlite WASM worker after each file to prevent exit code 100 (leaked handles).
import { afterAll } from "bun:test";
import { cachedClient } from "./helpers/db.ts";
afterAll(async () => {
if (cachedClient) {
await cachedClient.close();
}
});