feat(14-06): convert route tests + MCP tests to async PGlite

- All 8 route test files: async createTestApp(), async beforeEach
- MCP tools test: await createTestDb(), await getCollectionSummary()
- Fixed MCP tool files: added await to all service calls in items, categories, threads, setups tools
- Fixed MCP collection resource: made getCollectionSummary async
- Fixed MCP index.ts: await getCollectionSummary call
- Increased test timeout to 30s in bunfig.toml for PGlite WASM overhead
- Zero SQLite references remain in tests/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 15:40:14 +02:00
parent 458b33f1c7
commit f30d375544
15 changed files with 80 additions and 79 deletions

View File

@@ -6,8 +6,8 @@ import { setupRoutes } from "../../src/server/routes/setups";
import { threadRoutes } from "../../src/server/routes/threads";
import { createTestDb } from "../helpers/db";
function createTestApp() {
const db = createTestDb();
async function createTestApp() {
const db = await createTestDb();
const app = new Hono();
app.use("*", async (c, next) => {
c.set("db", db);
@@ -23,8 +23,8 @@ function createTestApp() {
describe("Invalid ID parameter handling", () => {
let app: Hono;
beforeEach(() => {
app = createTestApp();
beforeEach(async () => {
app = await createTestApp();
});
describe("items", () => {