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 { itemRoutes } from "../../src/server/routes/items.ts";
|
||||
import { setupRoutes } from "../../src/server/routes/setups.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
function createTestApp() {
|
||||
const db = createTestDb();
|
||||
async function createTestApp() {
|
||||
const db = await createTestDb();
|
||||
const app = new Hono();
|
||||
|
||||
app.use("*", async (c, next) => {
|
||||
@@ -39,8 +39,8 @@ async function createItemViaAPI(app: Hono, data: any) {
|
||||
describe("Setup Routes", () => {
|
||||
let app: Hono;
|
||||
|
||||
beforeEach(() => {
|
||||
const testApp = createTestApp();
|
||||
beforeEach(async () => {
|
||||
const testApp = await createTestApp();
|
||||
app = testApp.app;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user