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:
@@ -4,8 +4,8 @@ import { categoryRoutes } from "../../src/server/routes/categories.ts";
|
||||
import { itemRoutes } from "../../src/server/routes/items.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
function createTestApp() {
|
||||
const db = createTestDb();
|
||||
async function createTestApp() {
|
||||
const db = await createTestDb();
|
||||
const app = new Hono();
|
||||
|
||||
// Inject test DB into context for all routes
|
||||
@@ -22,8 +22,8 @@ function createTestApp() {
|
||||
describe("Item Routes", () => {
|
||||
let app: Hono;
|
||||
|
||||
beforeEach(() => {
|
||||
const testApp = createTestApp();
|
||||
beforeEach(async () => {
|
||||
const testApp = await createTestApp();
|
||||
app = testApp.app;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user