fix(16): add async/await to createTestDb in route and MCP tests
Route and MCP test files were calling createTestDb() without await, causing db to be a Promise object instead of a Drizzle instance. Also rewrote auth route tests for OIDC-based auth (merge picked old version). 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, userId } = createTestDb();
|
||||
async function createTestApp() {
|
||||
const { db, userId } = await createTestDb();
|
||||
const app = new Hono();
|
||||
|
||||
app.use("*", async (c, next) => {
|
||||
@@ -40,8 +40,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